Difference between revisions of "Troubleshooting GridPACK Builds"

From GridPACK
Jump to: navigation, search
 
(5 intermediate revisions by the same user not shown)
Line 17: Line 17:
 
to
 
to
  
     echo "using mpi : /absolute/path/to/mpi/C++/wrapper ;" > ~/user-config.jam
+
     echo "using mpi : mpicxx ;" > ~/user-config.jam
  
This assumes that you do have the more common <tt>mpicxx</tt> name in your environment. If that name isn't in your environment, then find the MPI wrapper name and use that. If the build still fails, include the entire path
+
This assumes that you have the more common <tt>mpicxx</tt> name in your environment. If <tt>mpicxx</tt> is not in your environment, then find the MPI wrapper name and use that. If the build still fails, include the entire path
  
 
     echo "using mpi : /absolute/path/to/mpi/C++/compiler/wrapper ;" > ~/user-config.jam
 
     echo "using mpi : /absolute/path/to/mpi/C++/compiler/wrapper ;" > ~/user-config.jam
  
Not that the spaces around <tt>:</tt> and before <tt>;</tt> are important and must be included in the above lines.
+
Note that the spaces around <tt>:</tt> and before <tt>;</tt> are important and must be included in the above lines.
  
 
==PETSc==
 
==PETSc==
Line 30: Line 30:
  
 
'''configure.log''': The <tt>configure.log</tt> file in the PETSc build directory can provide additional information on diagnosing build problems. You can identify which test failed and possibly get information on compiler errors from this file.
 
'''configure.log''': The <tt>configure.log</tt> file in the PETSc build directory can provide additional information on diagnosing build problems. You can identify which test failed and possibly get information on compiler errors from this file.
 +
 +
'''You do not have write permissions to the --prefix directory''': This error message appears if <tt>$PREFIX</tt> has not been set in your environment (assuming you are using this variable).
 +
 +
'''Link symbols missing''': If configure.log indicates that a link symbol is missing, you may need to make sure that these are included in the PETSc build environment. Most often these are symbols that can be included by adding -pthread to the linker. PETSc does not pay attention to environment variables so have to add them explicitly in the PETSc configure line as
 +
 +
    CFLAGS=-pthread CXXFLAG=-pthread FFLAG=-pthread
  
 
'''Noexec flag on /tmp''': This error (which is currently rare) occurs if <tt>/tmp</tt> has been mounted on your system with the <tt>noexec</tt> flag set. This flag will prevent you from executing anything in <tt>/tmp</tt>, even if the executable bit has been set on the file. PETSc uses this directory to create temporary files as part of its configuration process. For PETSc versions later than 3.6, you should be able to get around this problem by setting the <tt>TMPDIR</tt> environment to some directory where you have both write and execute permissions. This problem is difficult to diagnose and your best bet may be to just try setting <tt>TMPDIR</tt> and see if your configuration problems go away. On some systems, you may be able to see if the <tt>noexec</tt> flag is set by typing
 
'''Noexec flag on /tmp''': This error (which is currently rare) occurs if <tt>/tmp</tt> has been mounted on your system with the <tt>noexec</tt> flag set. This flag will prevent you from executing anything in <tt>/tmp</tt>, even if the executable bit has been set on the file. PETSc uses this directory to create temporary files as part of its configuration process. For PETSc versions later than 3.6, you should be able to get around this problem by setting the <tt>TMPDIR</tt> environment to some directory where you have both write and execute permissions. This problem is difficult to diagnose and your best bet may be to just try setting <tt>TMPDIR</tt> and see if your configuration problems go away. On some systems, you may be able to see if the <tt>noexec</tt> flag is set by typing
Line 35: Line 41:
 
     findmnt --target /tmp
 
     findmnt --target /tmp
  
The PETSc development team is aware of this problem and may provide a fix, or at least better diagnostics, in a later release (post 3.9.2).
+
The PETSc development team is aware of this problem and may provide a fix in a later release (post 3.9.2), or at least better diagnostics.
 +
 
 +
'''Problem building on Mac OS''': We have encountered problems configuring and compiling on some Macs running High Sierra (Version 10.13.6). The problem may be associated with recent versions of Xcode.
 +
 
 +
Configure may fail with an error
 +
 
 +
    TESTING: checkFortranLibraries from config.compilers(config/BuildSystem/config/compilers.py:868)
 +
    *******************************************************************************
 +
            CONFIGURATION CRASH  (Please send configure.log to petsc-maint@mcs.anl.gov)
 +
    *******************************************************************************
 +
 
 +
This is a bug in the compilers.py script (this has been fixed in the PETSc 3.10 release). Fix it by editing the <tt>config/BuildSystem/config/compilers.py</tt> file. Search for <tt>endwith</tt> and replace it with <tt>endswith</tt>. PETSc should configure after this.
 +
 
 +
The second problem occurs when you try and compile PETSc after configuring it. The build will halt with the error
 +
 
 +
    /Users/d3g293/software/petsc-3.9.4/src/sys/classes/draw/utils/image.c:58:10: fatal error: 'png.h' file not found
 +
    #include <png.h>
 +
            ^22:21, 4 January 2019 (UTC)~
 +
    1 error generated.
 +
    make[2]: *** [arch-macosx-clang-real-opt/obj/sys/classes/draw/utils/image.o] Error 1
 +
    make[2]: *** Waiting for unfinished jobs....
 +
 
 +
This can be fixed by editing the file arch-macosx-clang-real-opt/include/petscconf.h under the top-level PETSc directory and removing the lines
 +
 
 +
    #ifndef PETSC_HAVE_LIBPNG
 +
    #define PETSC_HAVE_LIBPNG 1
 +
    #endif
 +
 
 +
and
 +
 
 +
    #ifndef PETSC_HAVE_LIBJPEG
 +
    #define PETSC_HAVE_LIBJPEG 1
 +
    #endif
 +
 
 +
The build should now work (type '<tt>make all</tt>').

Latest revision as of 22:21, 4 January 2019

This page is under construction

This page is a collection of trouble shooting tips that have proven useful in the past. If you run into problems building GridPACK or its associated libraries, you may find some useful suggestions here. If you continue to have problems, feel free to contact us.

Boost

Mismatch between compiler and Boost versions: Boost employs the latest features in C++ and a Boost version that was released much later than the compiler version may not compile. You can fix this by using an earlier version of Boost. Alternatively, you can move to a more recent compiler, but this is usually more difficult to do.

Boost cannot find MPI: Boost is actually looking for the mpic++ wrapper to the C++ compiler. You can tell if this is in your environment by typing

   which mpic++

If it isn't in your environment, then you need to modify the first line in the configuration

   echo "using mpi ;" > ~/user-config.jam

to

   echo "using mpi : mpicxx ;" > ~/user-config.jam

This assumes that you have the more common mpicxx name in your environment. If mpicxx is not in your environment, then find the MPI wrapper name and use that. If the build still fails, include the entire path

   echo "using mpi : /absolute/path/to/mpi/C++/compiler/wrapper ;" > ~/user-config.jam

Note that the spaces around : and before ; are important and must be included in the above lines.

PETSc

Configuration error messages: The error messages that PETSc provides during configuration are frequently informative and can provide important information on why configuration failed, as well as pointing to potential solutions. Check these first.

configure.log: The configure.log file in the PETSc build directory can provide additional information on diagnosing build problems. You can identify which test failed and possibly get information on compiler errors from this file.

You do not have write permissions to the --prefix directory: This error message appears if $PREFIX has not been set in your environment (assuming you are using this variable).

Link symbols missing: If configure.log indicates that a link symbol is missing, you may need to make sure that these are included in the PETSc build environment. Most often these are symbols that can be included by adding -pthread to the linker. PETSc does not pay attention to environment variables so have to add them explicitly in the PETSc configure line as

   CFLAGS=-pthread CXXFLAG=-pthread FFLAG=-pthread

Noexec flag on /tmp: This error (which is currently rare) occurs if /tmp has been mounted on your system with the noexec flag set. This flag will prevent you from executing anything in /tmp, even if the executable bit has been set on the file. PETSc uses this directory to create temporary files as part of its configuration process. For PETSc versions later than 3.6, you should be able to get around this problem by setting the TMPDIR environment to some directory where you have both write and execute permissions. This problem is difficult to diagnose and your best bet may be to just try setting TMPDIR and see if your configuration problems go away. On some systems, you may be able to see if the noexec flag is set by typing

   findmnt --target /tmp

The PETSc development team is aware of this problem and may provide a fix in a later release (post 3.9.2), or at least better diagnostics.

Problem building on Mac OS: We have encountered problems configuring and compiling on some Macs running High Sierra (Version 10.13.6). The problem may be associated with recent versions of Xcode.

Configure may fail with an error

   TESTING: checkFortranLibraries from config.compilers(config/BuildSystem/config/compilers.py:868)
   *******************************************************************************
           CONFIGURATION CRASH  (Please send configure.log to petsc-maint@mcs.anl.gov)
   *******************************************************************************

This is a bug in the compilers.py script (this has been fixed in the PETSc 3.10 release). Fix it by editing the config/BuildSystem/config/compilers.py file. Search for endwith and replace it with endswith. PETSc should configure after this.

The second problem occurs when you try and compile PETSc after configuring it. The build will halt with the error

   /Users/d3g293/software/petsc-3.9.4/src/sys/classes/draw/utils/image.c:58:10: fatal error: 'png.h' file not found
   #include <png.h>
            ^22:21, 4 January 2019 (UTC)~
   1 error generated.
   make[2]: *** [arch-macosx-clang-real-opt/obj/sys/classes/draw/utils/image.o] Error 1
   make[2]: *** Waiting for unfinished jobs....

This can be fixed by editing the file arch-macosx-clang-real-opt/include/petscconf.h under the top-level PETSc directory and removing the lines

   #ifndef PETSC_HAVE_LIBPNG
   #define PETSC_HAVE_LIBPNG 1
   #endif

and

   #ifndef PETSC_HAVE_LIBJPEG
   #define PETSC_HAVE_LIBJPEG 1
   #endif

The build should now work (type 'make all').