claw-project / claw-compiler

CLAW Compiler for Performance Portability
https://claw-project.github.io
BSD 2-Clause "Simplified" License
40 stars 15 forks source link

[FreeBSD] configure: error: parser.h not found. Please attach --with-libxml2=<DIR> or --with-libxml2-include=<DIR>. #237

Closed mexas closed 6 years ago

mexas commented 7 years ago

Building claw-compiler from master, following your cmake build instructions. cmake runs ok. make throws this error:

checking whether time.h and sys/time.h may both be included... (cached) yes
configure: error: parser.h not found. Please attach --with-libxml2=<DIR> or --with-libxml2-include=<DIR>.
*** Error code 1

The error is from building OMNI. What is the right syntax to pass the above to configure?

clementval commented 7 years ago

You can pass additional option to the configure script with the cmake variable OMNI_CONF_OPTION as shown below:

cmake -DOMNI_CONF_OPTION="--with-libxml2=<path-to-your-libxml2>" . 
mexas commented 7 years ago

Thank you. I moved one step further. Now I have

checking for mpicc... mpicc
No supported C compiler was found.
This program supports following MPI compilers.
 - GNU Compiler (mpicc)
 - Intel Compiler (mpiicc)
 - PGI Compiler (mpicc)
 - Fujitsu Compiler (mpifccpx)
 - Cray Compiler (cc)
 - NEC Compiler (sxmpic++)
 - IBM Compiler (mpixlcxx_r)
 - HITACHI Compiler (mpCC_r)
*** Error code 1

My mpicc is:

[mexas@20474701626e ~/nobkp/claw/claw-compiler/build]$ mpicc --version
FreeBSD clang version 4.0.0 (tags/RELEASE_400/final 297347) (based on LLVM 4.0.0)
Target: x86_64-unknown-freebsd11.1
Thread model: posix
InstalledDir: /usr/bin

is this not supported?

clementval commented 7 years ago

This is related to the underlying OMNI Compiler. You can try to specify it like this

cmake -DOMNI_MPI_CC="MPI_CC=cc" -DOMNI_MPI_FC="MPI_FC=ftn" . 

Where cc and ftn would be your MPI C compiler and your MPI FORTRAN Compiler.

clementval commented 7 years ago

@mexas After a quick look at OMNI Compiler configure script, it looks like clang is not a supported compiler at the time. I recommend to use gcc/gfortran if you have it available on your machine. It is probably something that should be supported in the future anyway.

mexas commented 7 years ago

ok, thanks. I rebuilt mpicc with gcc:

20474701626e> mpicc --version
gcc7 (FreeBSD Ports Collection) 7.1.0

Also I now run cmake with explicitly chosen gcc C compiler:

FC=gfortran7 CC=gcc7 CXX=g++7 cmake -DOMNI_CONF_OPTION="--with-libxml2=/usr/local" ..

Now on running make I get stopped here:

config.status: executing depend commands
Creating empty ./Driver/atool/src/cmd/.depend ... Done.
Creating empty ./Driver/atool/src/lib/.depend ... Done.
make[3]: "/home/mexas/nobkp/claw/claw-compiler/omni-compiler/Driver/atool/Makefile" line 6: Cannot open /Driver/atool/mk/vars.mk
make[3]: "/home/mexas/nobkp/claw/claw-compiler/omni-compiler/Driver/atool/Makefile" line 9: Unassoc"ated shell command "$(TOPDIR)/Driver/atool/src/include/nata \
make[3]: "/home/mexas/nobkp/claw/claw-compiler/omni-compiler/Driver/atool/Makefile" line 10: Unassociated shell command "$(TOPDIR)/Driver/atool/src/cmd"
make[3]: "/home/mexas/nobkp/claw/claw-compiler/omni-compiler/Driver/atool/Makefile" line 12: Cannot open /Driver/atool/mk/rules.mk
make[3]: Fatal errors encountered -- cannot continue
make[3]: stopped in /home/mexas/nobkp/claw/claw-compiler/omni-compiler/Driver/atool
==================================================
  -- Configuration Summary --

  PREFIX : /usr/local

  Local Compilers:
    C compiler (CC)                      : /usr/local/bin/gcc7
    C compiler flags (CFLAGS)            : -g -O2 -std=gnu99 -Wall -Wpointer-arith
    Fortran compiler (FC)                : /usr/local/bin/gfortran7
    Fortran compiler flags (FCFLAGS)     : -g -O2
    Java application launcher (JAVA)     : /usr/local/bin/java
    Java compiler (JAVAC)                : /usr/local/bin/javac
    Java Archive Tool (JAR)              : /usr/local/bin/jar

  Native Compilers:
    C preprocessor (MPI_CPP)                    : /usr/local/bin/mpicc
    C preprocessor flags (MPI_CPPFLAGS)         : -E -std=gnu99
    C compiler (MPI_CC)                         : /usr/local/bin/mpicc
    C compiler flags (MPI_CFLAGS)               : -O2 -std=gnu99 -Wall -Wpointer-arith -fopenmp
    C compiler linker flags (MPI_CLIBS)         : 
    Fortran preprocessor (MPI_FPP)              : /usr/local/bin/mpif90
    Fortran preprocessor flags (MPI_FPPFLAGS)   : -E -cpp
    Fortran compiler (MPI_FC)                   : /usr/local/bin/mpif90
    Fortran compiler flags (MPI_FCFLAGS)        : -O2 -fopenmp
    Fortran compiler linker flags (MPI_FCLIBS)  : 
    MPI Version                                 : 3.1

  Note: If you want to change above compilers and their options,
        please rerun ./configure MPI_CC=...

  Options:
    BLAS Library                 : no
    OpenACC                      : no
    Onesided                     : yes
      Communication Library      : MPI3
      Coarray                    : yes
      Post/Wait                  : yes
      Lock/Unlock                : no
==================================================
[100%] Performing build step for 'omni-compiler'
make[3]: "/home/mexas/nobkp/claw/claw-compiler/omni-compiler/Makefile" line 17: Missing dependency operator
make[3]: "/home/mexas/nobkp/claw/claw-compiler/omni-compiler/Makefile" line 19: Need an operator
make[3]: "/home/mexas/nobkp/claw/claw-compiler/omni-compiler/Makefile" line 22: Missing dependency operator
make[3]: "/home/mexas/nobkp/claw/claw-compiler/omni-compiler/Makefile" line 24: Need an operator
make[3]: "/home/mexas/nobkp/claw/claw-compiler/omni-compiler/Makefile" line 27: Missing dependency operator
make[3]: "/home/mexas/nobkp/claw/claw-compiler/omni-compiler/Makefile" line 29: Need an operator
make[3]: "/home/mexas/nobkp/claw/claw-compiler/omni-compiler/Makefile" line 32: Missing dependency operator
make[3]: "/home/mexas/nobkp/claw/claw-compiler/omni-compiler/Makefile" line 34: Need an operator
make[3]: "/home/mexas/nobkp/claw/claw-compiler/omni-compiler/Makefile" line 75: Missing dependency operator
make[3]: "/home/mexas/nobkp/claw/claw-compiler/omni-compiler/Makefile" line 77: Need an operator
make[3]: "/home/mexas/nobkp/claw/claw-compiler/omni-compiler/Makefile" line 84: Missing dependency operator
make[3]: "/home/mexas/nobkp/claw/claw-compiler/omni-compiler/Makefile" line 86: Need an operator
make[3]: "/home/mexas/nobkp/claw/claw-compiler/omni-compiler/Makefile" line 98: Missing dependency operator
make[3]: "/home/mexas/nobkp/claw/claw-compiler/omni-compiler/Makefile" line 103: Need an operator
make[3]: "/home/mexas/nobkp/claw/claw-compiler/omni-compiler/Makefile" line 105: Need an operator
make[3]: "/home/mexas/nobkp/claw/claw-compiler/omni-compiler/Makefile" line 108: Missing dependency operator
make[3]: "/home/mexas/nobkp/claw/claw-compiler/omni-compiler/Makefile" line 113: Need an operator
make[3]: "/home/mexas/nobkp/claw/claw-compiler/omni-compiler/Makefile" line 115: Need an operator
make[3]: "/home/mexas/nobkp/claw/claw-compiler/omni-compiler/Makefile" line 118: Missing dependency operator
make[3]: "/home/mexas/nobkp/claw/claw-compiler/omni-compiler/Makefile" line 123: Need an operator
make[3]: "/home/mexas/nobkp/claw/claw-compiler/omni-compiler/Makefile" line 125: Need an operator
make[3]: Fatal errors encountered -- cannot continue
make[3]: stopped in /home/mexas/nobkp/claw/claw-compiler/omni-compiler
*** Error code 1

Stop.
make[2]: stopped in /home/mexas/nobkp/claw/claw-compiler/build
*** Error code 1

Please advise.

Many thanks!

mexas commented 7 years ago

can it be because on FreeBSD make is a BSD make, and GNU make is gmake. I tried to invoke gmake instead of make, but perhaps in some scripts inside still make is invoked, assuming make is GNU make. So how can I propagate the use of gmake to all scripts?

clementval commented 7 years ago

@mexas Yes, it can be the cause of the error. OMNI Compiler uses the GNU autotools to generate the Makefiles in the project. You can also go in the submodule directory and compile OMNI Compiler by hand.

cd omni-compiler
./configure ...
gmake

You can redefine the MAKE variable to change which make is invoked.

MAKE=gmake ...

This should do the trick.

mexas commented 7 years ago

I now get build errors inside omni-compiler. I'll talk to them directly. Please keep this issue open for now.

clementval commented 7 years ago

@mexas If you know a free service like Travis CI that allow FreeBSD CI, I can think to integrate it.

mexas commented 7 years ago

good question. I'll check. There's https://ci.freebsd.org but I think it's only for testing FreeBSD building itself on FreeBSD

mexas commented 7 years ago

seems there's nothing. I'm told Travis might support FreeBSD in future, but not yet. The best thing is for me to make a FreeBSD port of your project, but then until the port is proven to build the FreeBSD ports people are reluctant to include it in their CI workflow. I'll keep you updated.