I’m attempting to install Dakota 6.3.0 on a 64-bit Linux box from source (to link python and MATLAB), and Dakota is having trouble finding some dependencies. I’ve been able to install and use Dakota successfully on my previous machine (64-bit, OpenSUSE 13.2) without any problems. Now that I upgraded to the more recent version of OpenSUSE (Opensuse Leap 42.1), I’m not able to get past this error.
I am using cmake to build the source and create a makefile. At around 5% of compiling I get this error:
- 5%] Building CXX object packages/OPTPP/src/CMakeFiles/optpp.dir/globals.C.o*
In file included from /opt/dakota/dakota-6.3.0.src/packages/OPTPP/src/globals.C:4:0:
/opt/dakota/dakota-6.3.0.src/packages/OPTPP/include/globals.h:22:41: fatal error: Teuchos_SerialDenseMatrix.hpp: No such file or directory
#include “Teuchos_SerialDenseMatrix.hpp”
-
^*
compilation terminated.
I looked for the missing file ‘Teuchos_SerialDenseMatrix.hpp’, and see that I have two copies on my computer from installing trilinos 11.4.3 through the package manager. One is located under ‘/usr/include/trilinos’, and the other is located ‘/usr/lib64/mpi/gcc/openmpi/include/trilinos’. I’m not sure why I have two copies…
I added both of those directories to LD_LIBRARY_PATH in ~/.bashrc, but the error keeps coming up that Dakota isn’t able to find the file. Can anyone help me with this installation issue?
THe path is hard coded so you must but the files whre it expects or set links to existing files at the expected local
The required header file was downloaded through YaST as part of the trilinos and trilinos-devel packages, and it looks like there were some changes in the file structure. Building the source with the ‘old’ trilinos directory (/usr/include/trilinos) produces the following error:
CMake Warning at /usr/include/trilinos/TrilinosConfig.cmake:44 (MESSAGE):
TrilinosConfig.cmake has moved. It now exists at a location under the
installation prefix where the find_package command looks by default
(<prefix>/lib/cmake/Trilinos). This compatibility file exists at the old
location (<prefix>/include) to present this message and load the file from
its new location.
The find_package() call that loaded this file did so because its cached
result variable, Trilinos_DIR, is set to
/usr/include/trilinos
I'm locally setting Trilinos_DIR to
/usr/include/lib/cmake/Trilinos
and loading TrilinosConfig.cmake from its new location. One may suppress
this warning by setting the above value in the cache. However, the
application needs modification permanently fix the issue. The
find_package() call that loaded this file may have the form
find_package(Trilinos REQUIRED PATHS ${Trilinos_PATH}/include)
Change it to the form
set(CMAKE_PREFIX_PATH ${Trilinos_PATH} ${CMAKE_PREFIX_PATH})
find_package(Trilinos REQUIRED)
to find TrilinosConfig.cmake in its new location in future builds while
still honoring the Trilinos_PATH option for this application.
Call Stack (most recent call first):
CMakeLists.txt:352 (find_package)
CMake Error at /usr/include/trilinos/TrilinosConfig.cmake:66 (INCLUDE):
include could not find load file:
/usr/include/lib/cmake/Trilinos/TrilinosConfig.cmake
Call Stack (most recent call first):
CMakeLists.txt:352 (find_package)
Using system trilinos in /usr/include/lib/cmake/Trilinos
Using system trilinos in /usr/lib64/mpi/gcc/openmpi/lib64/cmake/Trilinos
Using system trilinos in /usr/lib64/mpi/gcc/openmpi/lib64/cmake/Trilinos
Using system trilinos in /usr/lib64/mpi/gcc/openmpi/lib64/cmake/Trilinos
This leads me to understand that the Makefile isn’t aware of the new file structure and is looking in the wrong place. The error message above is contained within ‘/usr/include/trilinos/TrilinosConfig.cmake’, presumably the old location. Coincidentally, the required header file I’m having trouble with is also in that directory. The new version of that file is located here: ‘/usr/lib64/mpi/gcc/openmpi/lib64/cmake/Trilinos/TrilinosConfig.cmake’; however, the message in the old one is sending it to the wrong place. The new version of the header file is in a separate directory. Apparently cmake found the system trilinos, but can’t find the required header files…
Is this an openSUSE issue?
could be directories wonder a bit between ditros. Just be sure a link or the files is wher make expects it. Path does not work in the case of hard code paths
I think I found the error. Calling ‘make’ with the verbose output option set like this:
make VERBOSE=1
shows the compiler flags used in the build process. I think the error is what I set in bold:
Scanning dependencies of target optpp
make[2]: Leaving directory '/opt/dakota/dakota-6.3.0.build'
make -f packages/OPTPP/src/CMakeFiles/optpp.dir/build.make packages/OPTPP/src/CMakeFiles/optpp.dir/build
make[2]: Entering directory '/opt/dakota/dakota-6.3.0.build'
5%] Building CXX object packages/OPTPP/src/CMakeFiles/optpp.dir/globals.C.o
cd /opt/dakota/dakota-6.3.0.build/packages/OPTPP/src && /usr/bin/c++ -DBOOST_SIGNALS_NO_DEPRECATION_WARNING -DDAKOTA_OPTPP -DHAVE_STD -DHAVE_SYS_TIMES_H -DHAVE_SYS_TIME_H -DHAVE_TIMES -Doptpp_EXPORTS -I/opt/dakota/dakota-6.3.0.build/packages/OPTPP/include -I/opt/dakota/dakota-6.3.0.src/packages/OPTPP/include **-I/usr/lib64/mpi/gcc/openmpi/lib64/cmake/Teuchos/../../../usr/lib64/mpi/gcc/openmpi/include/trilinos** -I/opt/dakota/dakota-6.3.0.src/packages/ampl -I/opt/dakota/dakota-6.3.0.build/packages/ampl -I/opt/dakota/dakota-6.3.0.src/packages/OPTPP/src/Base -I/opt/dakota/dakota-6.3.0.src/packages/OPTPP/src/Constraints -I/opt/dakota/dakota-6.3.0.src/packages/OPTPP/src/GSS -I/opt/dakota/dakota-6.3.0.src/packages/OPTPP/src/Newton -I/opt/dakota/dakota-6.3.0.src/packages/OPTPP/src/PDS -I/opt/dakota/dakota-6.3.0.src/packages/OPTPP/src/Utils -fPIC -o CMakeFiles/optpp.dir/globals.C.o -c /opt/dakota/dakota-6.3.0.src/packages/OPTPP/src/globals.C
In file included from /opt/dakota/dakota-6.3.0.src/packages/OPTPP/src/globals.C:4:0:
/opt/dakota/dakota-6.3.0.src/packages/OPTPP/include/globals.h:22:41: fatal error: Teuchos_SerialDenseMatrix.hpp: No such file or directory
#include "Teuchos_SerialDenseMatrix.hpp"
^
compilation terminated.
The compiler flag is not set correctly - it’s treating an absolute path as a relative path. Is this a bug in the trilinos package sent out with openSUSE, or with the Dakota package that I’m trying to install along with it?
Solved.
I found the bug and was able to keep working with a small workaround. Using ccmake, I set ‘CMAKE_CXX_FLAGS’ equal to ‘-I/usr/lib64/mpi/gcc/openmpi/include/trilinos’
This looks like a bug in Dakota’s source somewhere, I’ll take it up with them. Thanks for the help.
Cheers,
cbcoutinho