ISSM configuration and compilation
Compiling MEX Files on macOS with the Command Line ToolsMany Mac users prefer to install just the Command Line Tools and not the full Xcode application due to its size and because they are not developing apps for Apple operating systems. This can cause an issue in some cases where MEX files cannot be compiled out of the box. Essentially, the Xcode license has to be accepted before its compilers can be used, but there is no Xcode to start up! This can be fixed by running, VER=$(pkgutil --pkg-info=com.apple.pkg.CLTools_Executables); defaults write com.apple.dt.Xcode IDEXcodeVersionForAgreedToGMLicense ${VER}
in a terminal. NOTE: This will need to be done for each user on the machine that will be compiling MEX files. configure: error: Couldn't find mex... check your installation of matlabThis error message typically happens on Macs, because MATLAB does not support XCode7.0. MATLAB provides a patch available here. If this fix does not work, you can do the following maneuver manually. In MATLAB, open the xml file that specifies where the SDK is located: edit ([matlabroot '/bin/maci64/mexopts/clang++_maci64.xml'])
Toward the bottom, you will see a line that look like this, referencing "10.10": <dirExists name="$$/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk" />
Copy and paste this line (immediately after the first) and change the second one to "10.11", like this: <dirExists name="$$/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk" />
<dirExists name="$$/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk" />
Do this against for another instance in this file, both must be modified. This should allow you to link against the OS X 10.11 SDK, but please be aware that this is configuration that has not been validated by MathWorks. If you want to check that #include <mex.h>
void mexFunction(int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]){}
Let's call this file mex conftest.cpp
If it fails, your mex compiler is still not working, please contact MATLAB support and send them this file. MATLAB MEX compile errorIn file included from /Applications/MATLAB_R2013a.app/extern/include/mex.h:58:
In file included from /Applications/MATLAB_R2013a.app/extern/include/matrix.h:294:
/Applications/MATLAB_R2013a.app/extern/include/tmwtypes.h:819:9: error: unknown type name 'char16_t'
typedef char16_t CHAR16_T;
This happens after an upgrade of XCode, which also upgraded the C/C++ compiler, which MATLAB is not aware of. Add the following line to export CXXFLAGS=" -std=c++11"
Reconfigure and recompile. Missing gfortran symbolIf you get the following error message: CXX main/issm_slr-issm_slr.o
CXX main/kriging-kriging.o
CXXLD issm.exe
/bin/ld: ./.libs/libISSMCore.so: undefined reference to symbol '_gfortran_transfer_real_write@@GFORTRAN_1.4'
//usr/lib64/libgfortran.so.3: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
This is because you need to tell ISSM where your gfortran library is located. One way to do this is to do: $mpif77 -print-file-name="libgfortran.a"
This will return the path to the gfortran library that was used to compile mpich and PETSc. If, for example, you get: $/usr/lib/gcc/x86_64-linux-gnu/7/libgfortran.a
The path to the gfortran library in this case is --with-fortran-lib="/usr/lib/gcc/x86_64-linux-gnu/7/ -lgfortran" \
You can then reconfigure and recompile ISSM: $ ./configure.sh
$ make
$ make install
*** No rule to make targetIf you get the following error message: make[3]: *** No rule to make target `objects/Gauss/GaussTria.cpp', needed by
`libISSMCore_a-GaussTria.o'. Stop.
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
This is because you just updated ISSM and you need to clean the trunk: $ cd $ISSM_DIR
$ make distclean
and then you will need to reconfigure: $ cd $ISSM_DIR
$ ./scripts/automakererun.sh
ISSM can then be configured for the given OS. Several scripts exist to configure ISSM, they are all located in $ ./configure.sh
$ make
$ make install
Error message when compiling, with unresolved symbols in PETScThe issue may lie with the external package PETSc, which you should compile with shared libraries enabled. Otherwise, at run time, on some platforms, python will not be able to resolve the PETSc symbols using statically compiled PETSc's libraries. Linkage Error for drand48 and srand48 specifications in Windowsc:\issmuci\trunk-jpl\externalpackages\petsc\install\include\petscfix.h(12) : error
C2732: linkage specification contradicts earlier specification for 'drand48'
c:\issmuci\trunk-jpl\externalpackages\petsc\install\include\petscfix.h(12) : see declaration
of 'drand48'
c:\issmuci\trunk-jpl\externalpackages\petsc\install\include\petscfix.h(13) : error C2732:
linkage specification contradicts earlier specification for 'srand48'
c:\issmuci\trunk-jpl\externalpackages\petsc\install\include\petscfix.h(13) : see
declaration of 'srand48'
This error message indicates that PETSc is not linking properly with your issm due to a C-specific definition in a header file. The petsc header file needs to be patched. Open 10 //extern "C" {
11 int getdomainname(char *, int);
12 double drand48();
13 void srand48(long);
14 //}
wget: symbol lookup errorIf you get the following error message, wget: symbol lookup error: wget: undefined symbol: psl_str_to_utf8lower
when running an external package's installation script, it is likely due to the fact that you have installed GMT (for example, for a build that features Dakota) and then run: source $ISSM_DIR/etc/environment.sh
What is happeneing here is that GMT has its own copy of source $ISSM_DIR/etc/environment.sh
then try to install the external package again, X11 Library not foundg++: /usr/lib64/libX11.so: No such file or directory
This error message indicates that your X11 library is not located in --with-graphics-lib="/usr/lib/x86_64-linux-gnu/libX11.so"
MPICH2 linking error/trunk/externalpackages/mpich2/install/lib//libmpich.a(init.o):
In function `MPI_Init':
init.c:(.text+0x48): undefined reference to `MPL_env2str'
init.c:(.text+0x93): undefined reference to `MPL_env2bool'
This error message indicates that you are using --with-mpi-lib="-L$ISSM_DIR/externalpackages/mpich2/install/lib/ -lmpich -lmpl"
|