FreeFem / FreeFem-sources

FreeFEM source code
https://freefem.org/
Other
770 stars 191 forks source link

Problems compiling on Arch #46

Closed sgarnotel closed 5 years ago

sgarnotel commented 6 years ago

Original post from FreeFem-doc #5 :

Sorry if this is the inappropriate place or way to complain, but i had some problems compiling Freefem++ on arch (Manjaro to be exact). the error occured after the "./reconfigure" step expected behaviour: "make" causes freefem to compile actual behaviour: there is a "missing seperator" error and the compilation stopped after the command "make" is execured.

i think i solved the issue, by removing all lines that only said "dir" from all files called "Makefile" since this line caused the error. to my very limited knolege of makefiles this line made no sence there. here is a INCOMPLETE list of places this line occured: File Line String ./examples++-eigen/Makefile 396 dir ./examples++-mpi/Makefile 419 dir ./examples++-tutorial/Makefile 398 dir ./examples++/Makefile 398 dir ./examples++-load/Makefile 437 dir ./examples++-hpddm/Makefile 419 dir ./examples++-chapt3/Makefile 398 dir ./src/bamglib/Makefile 199 dir ./src/Makefile 257 dir ./src/Algo/Makefile 199 dir ./src/bamg/Makefile 237 dir ./src/mpi/Makefile 275 dir ./src/lglib/Makefile 253 dir ./src/fflib/Makefile 277 dir ./src/medit/Makefile 254 dir ./src/bin-win32/Makefile 192 dir ./src/femlib/Makefile 199 dir ./src/Graphics/Makefile 192 dir ./src/nw/Makefile 268 dir ./examples++-other/Makefile 396 dir ./examples++-bug/Makefile 194 dir ./examples++-3d/Makefile 398 dir

sgarnotel commented 6 years ago

Thanks for feedback, try to disable hdf5 during configuration:

./configure [...] --with-hdf5=no

It recently had an update of hdf5 that probably broke the FreeFem++ interface

SRaent commented 6 years ago

this change, removing "dir" still did not work, compilation failed after some time with the following error:

gfortran -O -g -DNDEBUG -O3 -mmmx -msse4.2 -fPIC -I/home/moritz/FreeFem-sources/download//include/scotch -Dscotch -Dpord -I. -I../include -c mumps_static_mapping.F -o mumps_static_mapping.o mumps_static_mapping.F:3945: Error: Can't open included file 'mpif.h'

i will now try your suggestion --with-hdf5=no

sgarnotel commented 6 years ago

The mpif.h dependency is an other bug. Did you compile ff-petsc afeter configure & download steps ? Compatibility with Arch is really hard due to rolling release development cycle, it seems to have a lot of bugs introduce with gcc 8

frederichecht commented 6 years ago

yes, the compilation of e ff-petsc is after configure to have the correct CC, CXX,FC, FLAGS

this is use to get the following variable:

abs_top_builddir=/Users/hecht/ff/ff-git CC=gcc

FC : Fortran 90 compiler

FC=ifort BLASLIBS = -Wl,-rpath,/opt/intel/mkl/lib -L/opt/intel/mkl/lib -lmkl_rt -lmkl_sequential -lmkl_core -liomp5 -lpthread -lmkl_rt -lmkl_sequential -lmkl_core -liomp5 -lpthread LAPACKLIBS= -Wl,-rpath,/opt/intel/mkl/lib -L/opt/intel/mkl/lib -lmkl_rt -lmkl_sequential -lmkl_core -liomp5 -lpthread -lmkl_rt -lmkl_sequential -lmkl_core -liomp5 -lpthread

Use:

-DAdd_ if your Fortran compiler adds an underscore at the end

of symbols,

-DAdd__ if your Fortran compiler adds 2 underscores,

#

-DUPPER if your Fortran compiler uses uppercase symbols

#

leave empty if your Fortran compiler does not change the symbols.

# CFLAGS=-g -m64 -fPIC -DNDEBUG -O3 -O3 -O3 -fPIC FCFLAGS=-g -fPIC CFLAGSF77=-DAdd_ MPI_INCLUDE=-I/usr/local/ff++/openmpi-2.1/include MPI_INC_DIR=/usr/local/ff++/openmpi-2.1/include MPI_LIB=-L/usr/local/ff++/openmpi-2.1/lib -lmpi MPI_LIBC= MPI_LIBFC=-Wl,-flat_namespace -L/usr/local/ff++/openmpi-2.1/lib -lmpi_usempif08 -lmpi_usempi_ignore_tkr -lmpi_mpifh -lmpi MPI_LIB_DIRS=/usr/local/ff++/openmpi-2.1/lib MPICC=/usr/local/ff++/openmpi-2.1/bin/mpicc MPICXX=/usr/local/ff++/openmpi-2.1/bin/mpic++ MPIF77=/usr/local/ff++/openmpi-2.1/bin/mpif90 MPIFC=/usr/local/ff++/openmpi-2.1/bin/mpif90 MPIPROG=FreeFem++-mpi MPIRUN=/usr/local/ff++/openmpi-2.1/bin//mpirun MPISCRIPT=ff-mpirun prefix=/usr/local/ff++/openmpi-2.1

Le 10 sept. 2018 à 13:35, Simon Garnotel notifications@github.com a écrit :

The mpif.h dependency is an other bug. Did you compile ff-petsc afeter configure & download steps ? Compatibility with Arch is really hard due to rolling release development cycle, it seems to have a lot of bugs introduce with gcc 8

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/FreeFem/FreeFem-sources/issues/46#issuecomment-419882565, or mute the thread https://github.com/notifications/unsubscribe-auth/AFb2jGbzJRjE757m6ohZp_oVnR28KTcJks5uZk59gaJpZM4WhL3R.

SRaent commented 6 years ago

i tried compiling with "--with-hdf5=no" and got the following error during "make". and i followed the steps for compilation on arch here http://doc.freefem.org/introduction/installation/. i also compiled with gcc-7. full configure command: "./configure --enable-download --enable-optim --disable-pastix CC=gcc-7 --with-hdf5=no" error message: (cd src ; make d) make[8]: Entering directory '/home/moritz/FreeFem-sources/download/mumps/MUMPS_5.0.2/src' make ARITH=d mumps_lib make[9]: Entering directory '/home/moritz/FreeFem-sources/download/mumps/MUMPS_5.0.2/src' gfortran -O -g -DNDEBUG -O3 -mmmx -msse4.2 -fPIC -I/home/moritz/FreeFem-sources/download//include/scotch -Dscotch -Dpord -I. -I../include -c double_linked_list.F -o double_linked_list.o gfortran -O -g -DNDEBUG -O3 -mmmx -msse4.2 -fPIC -I/home/moritz/FreeFem-sources/download//include/scotch -Dscotch -Dpord -I. -I../include -c ana_omp_m.F -o ana_omp_m.o gfortran -O -g -DNDEBUG -O3 -mmmx -msse4.2 -fPIC -I/home/moritz/FreeFem-sources/download//include/scotch -Dscotch -Dpord -I. -I../include -c tools_common_mod.F -o tools_common_mod.o gfortran -O -g -DNDEBUG -O3 -mmmx -msse4.2 -fPIC -I/home/moritz/FreeFem-sources/download//include/scotch -Dscotch -Dpord -I. -I../include -c mumps_static_mapping.F -o mumps_static_mapping.o mumps_static_mapping.F:3945: Error: Can't open included file 'mpif.h' make[9]: [Makefile:262: mumps_static_mapping.o] Error 1 make[9]: Leaving directory '/home/moritz/FreeFem-sources/download/mumps/MUMPS_5.0.2/src' make[8]: [Makefile:18: d] Error 2 make[8]: Leaving directory '/home/moritz/FreeFem-sources/download/mumps/MUMPS_5.0.2/src' make[7]: [Makefile:40: mumps_lib] Error 2 make[7]: Leaving directory '/home/moritz/FreeFem-sources/download/mumps/MUMPS_5.0.2' make[6]: [Makefile:24: d] Error 2 make[6]: Leaving directory '/home/moritz/FreeFem-sources/download/mumps/MUMPS_5.0.2' make[5]: [Makefile:69: MUMPS_5.0.2/FAIT] Error 2 make[5]: Leaving directory '/home/moritz/FreeFem-sources/download/mumps' make[4]: [Makefile:935: compile-dir] Error 2 make[4]: Leaving directory '/home/moritz/FreeFem-sources/download' make[3]: [Makefile:944: tag-compile-pkg] Error 1 make[3]: Leaving directory '/home/moritz/FreeFem-sources/download' make[2]: [Makefile:612: all-recursive] Error 1 make[2]: Leaving directory '/home/moritz/FreeFem-sources/download' make[1]: [Makefile:611: all-recursive] Error 1 make[1]: Leaving directory '/home/moritz/FreeFem-sources' make: [Makefile:561: all] Error 2

sgarnotel commented 6 years ago

Could you provide your gcc, openmpi versions ? Do you have compiled libraries that could be in interaction with the FreeFem++ compilation process ?

SRaent commented 6 years ago

gcc-7 (GCC) 7.3.1 20180814 openmpi-3.1.1-1

other libraries interfering? not that i know of, but i have honestly no idea.

sgarnotel commented 6 years ago

Could you post the output of:

autoreconf -i \
 && ./configure --enable-download --disable-pastix \
 && ./download/getall -a \
 && cd download/ff-petsc \
 && make petsc-slepc SUDO=sudo \
 && cd - \
 && make -j4 \
 && make check
sgarnotel commented 6 years ago

I have gcc8 on my computer, so I proceed as follow:

You can check during the make check that all works fine!

PS: by interfering librairies I think of user-compiled openmpi, gcc or other with specific options that could be detected by the configure step of FreeFem++ compilation and used to compile.

SRaent commented 6 years ago

https://pastebin.com/YhSurTvQ

i did not clean the folder or anything before running the command. also this command does not specify to use a different version of gcc, so it is not going to work anyway.

sgarnotel commented 6 years ago

Sorry I miss the --with-hdf5=no in the configure line. Could you execute make clean before recompiling ?

SRaent commented 6 years ago

i reloadet the compleat git repo, and used the following command: ./configure --enable-download --enable-optim --disable-pastix CC=gcc-7 --with-hdf5=no |& tee -a output.txt

here is the output.txt https://pastebin.com/BUScH9YA

sgarnotel commented 6 years ago

OK, now run make

SRaent commented 6 years ago

https://file.io/SH6Ni9

this skipped quite a lot of steps in the tutorial, so i was expecting it to fail

sgarnotel commented 6 years ago

We skip the PETSc/SLEPc compilation, this part is optional and only needed if you want to use PETSc. Could you post the output of find /usr/ -name mpif.h

SRaent commented 6 years ago

here is the output: /usr/include/mpif.h

sgarnotel commented 6 years ago

OK, it seems that configure process do not find mpif.h in the standard directory @frederichecht Could you modify download/mumps/Makefile.inc to append the path to the INCS variable:

INCS = $(INCPAR) -I/usr/include (upper i after the hypen)

(line 169 in my Makefile)

sgarnotel commented 6 years ago

Did you succeed ?

frederichecht commented 6 years ago

No I have no time to try to day.

Le 12 sept. 2018 à 15:48, Simon Garnotel notifications@github.com a écrit :

Did you succeed ?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/FreeFem/FreeFem-sources/issues/46#issuecomment-420654540, or mute the thread https://github.com/notifications/unsubscribe-auth/AFb2jHjf2rAz3qXcbwN6Yx3bGnSFNrmUks5uaRCUgaJpZM4WhL3R.

stefanhusmann commented 6 years ago

AUR-maintainer of freefem++git here.

I also have these "*** missing seperator" under Arch Linux since today. I think this is not related to the gcc version but to some broken Makefile generation. The corruptes Makefiles always have such lines in it:

gcc dir

(not only dir) which make misinterprets as targets, and therefore expects the following line to begin with a tabulator.

If I run

  find . -name Makefile -exec sed -i 's+^gcc+gcc =+' {} \;
  find . -name Makefile -exec sed -i 's+^dir+dir =+' {} \;

after the configure step the make process starts (I am currently rebuilding, but it seems to work).

A cleaner approach would be to generate correct Makefiles, but I did not figure out where these sparse lines come from.

The mpif.h issue cannot be reproduced here. I think configure detects the correct one for me. But this is probably due to the fact that I have freefem++ installed as a pacman package, which includes /usr/lib/ff++/3.61-2/include/mumps_seq/mpif.h. I have to check later if this also works if no freefem++ is installed.

Edit: build was working. I am running make check now.

sgarnotel commented 6 years ago

@stefanhusmann first thanks to maintain the AUR package.

The Makefile generation seems to be broken after an hdf5 update (more precisely h5cc update), see #47

That works on my system, could you check if this commit fix the Makefile generation for you too ?

sgarnotel commented 6 years ago

@SRaent any news? You could use the AUR package instead