DLR-AMR/t8code

Installation guide and first tutorial example comments

Closed this issue · 6 comments

Hi,

I am going through the installation (on MacOS Sonoma 14.5, Apple M1) and I have a couple problems. I will use $HOME/t8code_install as in the guide to indicate where I built t8code.

The last steps in the installation guide are as follows:

Add the library folder to LD_LIBRARY_PATH:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/t8code_install/lib
Add these to your compile line
-I$HOME/t8code_install/include
-L$HOME/t8code_install/lib
-lt8 -lp4est -lsc -lm -lz

but I don't have any lib folder in t8code_install, instead they are in t8code_install/local. Is this an expected behaviour?
When I do the suggested steps above for t8code_install/local and try to run c++ t8_step0_helloworld.cxx -I$HOME/t8code_install/local/include -L$HOME/t8code_install/local/lib -lt8 -lp4est -lsc -lm -lz, I get the error:
fatal error: 'mpi.h' file not found
#include <mpi.h>
^~~~~~~
1 error generated.
I used the suggested
configure CFLAGS="-O3" CXXFLAGS="-O3" --enable-mpi CC=mpicc CXX=mpicxx for the build.

Also, as a side comment, under the paragraph -Build t8code with CMake-, there is the subparagraph -tldr;- and following that -Installing using CMake-, what is the difference between the two?

Thanks a lot for any help,
Alessandro Contri

Hi @alecontri

you are probably getting the error because you are compiling using "gcc" and not "mpicc".

Could you try

mpicxx t8_step0_helloworld.cxx -I$HOME/t8code_install/local/include -L$HOME/t8code_install/local/lib -lt8 -lp4est -lsc -lm -lz

instead?

Yes, on some machines the files are installed in PREFIX/local, this should not make any difference, you correctly adapted the paths.

You could configure with --prefix=$HOME/t8code_install --exec-prefix=$HOME/t8code_install which should set t8code_install as the folder for lib and include.

"Also, as a side comment, under the paragraph -Build t8code with CMake-, there is the subparagraph -tldr;- and following that -Installing using CMake-, what is the difference between the two?"

I need to pass that question on to @jmark or @sandro-elsweijer who wrote a lot of the CMake system.

Hi @holke,

the use of gcc instead op mpicc was actually a big oversight, thanks a lot for pointing out. Now the output is:
[Alessandros-MacBook-Pro.local:70949] shmem: mmap: an error occurred while determining whether or not /tmp/ompi.Alessandros-MacBook-Pro.0/jf.0/332529664/sm_segment.Alessandros-MacBook-Pro.0.13d20000.0 could be created.
[libsc] This is libsc 2.8.5.406-2b20
[t8] This is t8 2.0.0.391-a5af3
[t8] CPP
[t8] CPPFLAGS
[t8] CC mpicc
[t8] CFLAGS -O3
[t8] LDFLAGS
[t8] LIBS -lz -lstdc++
[t8] [step0]
[t8] [step0] Hello, this is t8code :)
[t8] [step0]

Hi, its great to see that the code is running now.

We recently encountered issues with OpenMPI and shared memory support - especially on M1 - and this looks related to it.
As long as your tests pass (try running make check), you should be good for the time being.

Please refer to #1109 for the shmem issues.

I will close this issue for now, since the installation question is answered.

Linking this solved issue to the review for JOSS I am doing: openjournals/joss-reviews#6887