CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Installation

[OpenFOAM.com] Compiling library and solver fails (on a cluster) - spack error

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree2Likes
  • 1 Post By mia_k
  • 1 Post By Frensis

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 7, 2023, 10:54
Question Compiling library and solver fails (on a cluster) - spack error
  #1
New Member
 
Sabrina
Join Date: Sep 2023
Posts: 1
Rep Power: 0
mia_k is on a distinguished road
Hello all.



I'm new to Linux and OpenFOAM and I am working on a cluster for the first time. OpenFOAM (v2112) has been installed as a module by an admin via the package manager.
I work in my work directory /work/user/username. I have also cloned a repository into this directory. Now I want to compile the library and the solver and I get the following error message:


make: *** No rule to make target 'Spack', needed by '[spack'. Stop.
wmake error: file 'Make/linux64GccDPInt32-spack/sourceFiles' could not be created in /work/user/username/hydrology/src/hydrology

I put the $WM_PROJECT_DIR directory in my bashrc file (bashrc under $HOME/username/.bashrc).



Furthermore, I created my $WM_PROJECT_USER_DIR at the beginning of my work:
export WM_PROJECT_USER_DIR=$HOME/username/OpenFOAM/$USER-$WM_PROJECT_VERSION
mkdir $WM_PROJECT_USER_DIR --parent


Unfortunately, after that, I was told that I'd better store/run all things like my simulations in /work/user/username. I have now looked at the individual files inside the cloned repository - Allwmake (top-level) as well as files and options (under cluster/work/user/username/hydrology/src/hydrology/Make). However, I have not found anything that helps me.


And the query echo $FOAM_USER_APPBIN and echo $FOAM_USER_LIBBIN outputs:
/cluster/home/username/OpenFOAM/username-v2112/platforms/linux64GccDPInt32-spack/bin and /cluster/home/username/OpenFOAM/username-v2112/platforms/linux64GccDPInt32-spack/lib respectively.


In cluster/work/user/username/hydrology/src/hydrology/Make there is also the directory linux64GccDPInt32-spack. It contains the file options - when this file is opened, the following message is displayed:


[spack cc] ERROR: Spack compiler must be run from Spack! Input 'SPACK_ENV_PATH' is missing.


Unfortunately, I don't know what the errors mean or what I did wrong so far. I don't make any further progress, especially not with the message/error about the Spack compiler. My research into this issue did not help me. I don't know if the problem is that everything is in different directories or outside the directory where OpenFOAM is installed? Or is it because OpenFOAM is perhaps already pre-compiled (Here I read that I then need the dev/develop package?)?


I apologize for any possibly incorrect Linux/OpenFOAM-related terms and contexts. I am still new and currently working my way into the nomenclature. 😊


Would be really happy if someone could help me. 😊
Thanks in advance
Sabrina
thorstencoordes likes this.
mia_k is offline   Reply With Quote

Old   September 22, 2023, 07:28
Default Same spack error while compiling library on a cluster
  #2
New Member
 
Francesca
Join Date: Jul 2023
Location: Milan, Italy
Posts: 2
Rep Power: 0
Frensis is on a distinguished road
Hello,

I am facing an issue which is very similar to yours. When trying to compile my library on a cluster (same OpenFOAM version) with wmake libso I get the same error message as you:

[spack cc] ERROR: Spack compiler must be run from Spack! Input 'SPACK_ENV_PATH' is missing.

However, in the file options contained inside linux64GccDPInt32-spack (located in the same path as yours), I don't have the error message, but instead it says:

Code:
EXE_INC = -I$(LIB_SRC)/finiteVolume/lnInclude -I$(LIB_SRC)/fileFormats/lnInclude -I$(LIB_SRC)/meshTools/lnInclude -I$(LIB_SRC)/functionObjects/forces/lnInclude -I$(LIB_SRC)/dynamicMesh/lnInclude

LIB_LIBS = -lfiniteVolume -lmeshTools -lforces -ldynamicMesh
I am also new, to both OpenFOAM and clusters, so I really don't know how to solve this issue, and I don't find much information online about it.

By any chance, have you found a solution, or understood where this error comes from?
Or does anybody else reading know how to solve this issue?

Thanks,
Francesca
thorstencoordes likes this.
Frensis is offline   Reply With Quote

Old   November 4, 2025, 12:02
Default Fix
  #3
New Member
 
Tiziano Leone
Join Date: Jun 2023
Posts: 1
Rep Power: 0
Lionlie126 is on a distinguished road
I struggled a lot with this.
Initially I had to install my own spack package manager to solve it, but there is a much more elegant solution.

It might be useful for some.

You should directly source the bashrc of the openfoam version you are trying to compile to that has been installed with spack. It is not enough to load the spack package, because the installation will fail if you are not the person who installed the spack package.

So you should seek where is the path of the HPC system spack install, then the architecture in which your openfoam installation has been carried out, the compilers that was used for compiling and then the openfaom version of your interest.

the path to the bashrc to should be something like this

/spack/opt/spack/$ARCHITECTURE/$COMPILER/openfoam-2412-zilnpkwxfoxbtzdp3jkozakpybjizwoh/etc/bashrc

Then it is also important to make available in your path the compiler that was employed during the installation of openfoam.

for example if the location of my compiler folder is software/compilers/gcc-9.3.0 then I must export in my paths:

export PATH=/software/compilers/gcc-9.3.0/bin:$PATH
export LD_LIBRARY_PATH=/software/compilers/gcc-9.3.0/lib:/software/compilers/gcc-9.3.0/lib64:$LD_LIBRARY_PATH
export MANPATH=/software/compilers/gcc-9.3.0/share/man:$MANPATH
export INFOPATH=/software/compilers/gcc-9.3.0/share/info:$INFOPATH


Beware that it might be that the gcc version that was used to install your openfoam version was installed through spack aswell, compiled through another gcc, so you should seek your compilers both in the system-wide folders (as my example shows) and in some of the other gcc compilers in spack:

/spack/opt/spack/$ARCHITECTURE/$OTHER_COMPILER/$COMPILER


Once you have done this you should be able to compile your libraries on the cluster.
Lionlie126 is offline   Reply With Quote

Reply

Tags
cluster, compile, solver, spack

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[OpenFOAM.com] Compiling Scotch library error fedez91 OpenFOAM Installation 7 September 1, 2025 12:27
Duplicate library entries when running a solver with custom library francescomarra OpenFOAM Programming & Development 3 May 17, 2022 09:37
[OpenFOAM.org] Error compiling VOF HARDT Solver on OpenFoam 2.4.0 saddy OpenFOAM Installation 4 December 1, 2020 03:36
ERROR: unable to find library HJH CFX 6 February 26, 2019 07:52
Running UDF with Supercomputer roi247 FLUENT 4 October 15, 2015 14:41


All times are GMT -4. The time now is 07:24.