-
I tried to follow the build procedure verbatim, but clearly I am missing something. https://xyce.sandia.gov/documentation/BuildingGuide.html See install file and config log attached. Has this been built on Ubuntu 18.04? Exact procedure below. #!/bin/bash
###########################################################################
# References:
#
# https://xyce.sandia.gov/documentation/BuildingGuide.html
#
###########################################################################
#Dependancies
sudo apt-get install gfortran bison flex libfl-dev libfftw3-dev libsuitesparse-dev libsuitesparse-doc libblas-dev liblapack-dev libtool libopenmpi-dev openmpi-bin libtrilinos-teuchos-dev
###########################################################################
#Install Trilinos from source
wget https://github.com/trilinos/Trilinos/archive/trilinos-release-12-12-1.tar.gz
tar zxvf trilinos-release-12-12-1.tar.gz
mkdir -p XyceLibs/Serial
SRCDIR=$PWD/Trilinos-trilinos-release-12-12-1
ARCHDIR=$PWD/XyceLibs/Serial
FLAGS="-O3 -fPIC"
cmake \
-G "Unix Makefiles" \
-DCMAKE_C_COMPILER=gcc \
-DCMAKE_CXX_COMPILER=g++ \
-DCMAKE_Fortran_COMPILER=gfortran \
-DCMAKE_CXX_FLAGS="$FLAGS" \
-DCMAKE_C_FLAGS="$FLAGS" \
-DCMAKE_Fortran_FLAGS="$FLAGS" \
-DCMAKE_INSTALL_PREFIX=$ARCHDIR \
-DCMAKE_MAKE_PROGRAM="make" \
-DTrilinos_ENABLE_NOX=ON \
-DNOX_ENABLE_LOCA=ON \
-DTrilinos_ENABLE_EpetraExt=ON \
-DEpetraExt_BUILD_BTF=ON \
-DEpetraExt_BUILD_EXPERIMENTAL=ON \
-DEpetraExt_BUILD_GRAPH_REORDERINGS=ON \
-DTrilinos_ENABLE_TrilinosCouplings=ON \
-DTrilinos_ENABLE_Ifpack=ON \
-DTrilinos_ENABLE_Isorropia=ON \
-DTrilinos_ENABLE_AztecOO=ON \
-DTrilinos_ENABLE_Belos=ON \
-DTrilinos_ENABLE_Teuchos=ON \
-DTeuchos_ENABLE_COMPLEX=ON \
-DTrilinos_ENABLE_Amesos=ON \
-DAmesos_ENABLE_KLU=ON \
-DTrilinos_ENABLE_Sacado=ON \
-DTrilinos_ENABLE_Kokkos=OFF \
-DTrilinos_ENABLE_ALL_OPTIONAL_PACKAGES=OFF \
-DTrilinos_ENABLE_CXX11=ON \
-DTPL_ENABLE_AMD=ON \
-DAMD_LIBRARY_DIRS="/usr/lib" \
-DTPL_AMD_INCLUDE_DIRS="/usr/include/suitesparse" \
-DTPL_ENABLE_BLAS=ON \
-DTPL_ENABLE_LAPACK=ON \
$SRCDIR
make
sudo make install
##############################################################################
#Clone Xyce
git clone git@github.com:Xyce/Xyce.git
#Build Xyce
cd Xyce
./bootstrap
cd ../
./configure CXXFLAGS="-O3 -std=c++11" ARCHDIR="/home/aolofsson/work/darpa/POSH/sandia-spice/Serial" CPPFLAGS="-I/usr/include/suitesparse"
|
Beta Was this translation helpful? Give feedback.
Replies: 11 comments 15 replies
-
Please review the building guide's instructions about ARCHDIR. You are installing your Trilinos libraries into $HOME/XyceLibs/Serial, but are giving a completely different ARCHDIR to Xyce's configure script. They should be the same. From the building guide:
Since you are providing inconsistent ARCHDIRs to the two build processes, Xyce's configure is being told to look for Trilinos in some other place than where you actually installed it. Further, the building guide discourages you from attempting to use any version of Trilinos provided in your system's package management system, because no package managers ever build Trilinos with the same options that Xyce needs. From the "Install prerequisite packages" section:
You have "libtrilinos-teuchos-dev" in your apt-get command. You should remove this package, which may cause conflicts with the version you built from source . |
Beta Was this translation helpful? Give feedback.
-
A few more points: you are installing Trilinos to $HOME/XyceLibs/Serial, but are using "sudo make install" to do so. It is unnecessary to use sudo to install into a directory that you own, and doing so will simply make the files in your own home directory be owned by root instead of you. |
Beta Was this translation helpful? Give feedback.
-
One last batch of comments. It looks like you want Xyce itself to be installed in /home/aolofsson/work/darpa/POSH/sandia-spice/Serial, which you tried to do by specifying that directory as ARCHDIR. That's probably because we used that variable name to set the "CMAKE_INSTALL_PREFIX" in the instructions for building Trilinos. We did it that way to try to emphasize that Trilinos was getting installed into ARCHDIR, and we are later telling Xyce to look for it there by using a variable of the same name. ARCHDIR is used to tell configure where to look for libraries specific to your architecture (not necessarily just trilinos --- you could install other system-specific things there if you had to build them from source for some reason). If you want configure to set you up so that "make install" will put Xyce somewhere other than its default /usr/local (which we definitely recommend you do), you use the "--prefix" option to configure. From the building guide:
So what you really want in your configure line is: We also strongly discourage building the code inside its source directory, because that pollutes the directory with build artifacts, and can make it difficult to build multiple variants of Xyce (e.g. both serial and parallel builds) because droppings from a previous build might interfere with the next one. Instead of running "./configure" inside the source tree you should create an empty build directory somewhere and build there. This isolates the build artifacts from the source tree and keeps the source tree pristine. Please do the following instead of "./configure":
Your source tree will remain clean and your build directory will contain only build artifacts. Should you want to build Xyce for parallel runs as well, you would create a second build directory and issue your parallel configure line there. This technique is also useful when the source tree resides on a remotely mounted filesystem shared by multiple computers of different architectures --- the same source tree can be used to build for all the different systems without each system stepping on the other. The building guide's instructions all presuppose that you are following this guidance. Per the building guide, again:
This assumption of out-of-source builds is also evident in the Linux-specific example configure line we provide:
|
Beta Was this translation helpful? Give feedback.
-
Yes, I succeeded in the end. My apologies for turning an RTFM problem on my part into an issue. I do question why one would leave it up to stupid users (like me) to mess up the paths, if there is only one correct way of doing it. Attaching the script I used. ###########################################################################
# References:
#
# https://xyce.sandia.gov/documentation/BuildingGuide.html
# https://github.com/Xyce/Xyce
#
###########################################################################
###########################################################################
#Install Dependancies
###########################################################################
sudo apt-get install gfortran bison flex libfl-dev libtool
sudo apt-get install libfftw3-dev libsuitesparse-dev libblas-dev liblapack-dev
sudo apt-get install libopenmpi-dev openmpi-bin
###########################################################################
#Install Trilinos from source
###########################################################################
wget https://github.com/trilinos/Trilinos/archive/trilinos-release-12-12-1.tar.gz
tar zxvf trilinos-release-12-12-1.tar.gz
SRCDIR=$PWD/Trilinos-trilinos-release-12-12-1
LIBDIR=/opt/xyce/xyce_lib
INSTALLDIR=/opt/xyce/xyce_serial
FLAGS="-O3 -fPIC"
cmake \
-G "Unix Makefiles" \
-DCMAKE_C_COMPILER=gcc \
-DCMAKE_CXX_COMPILER=g++ \
-DCMAKE_Fortran_COMPILER=gfortran \
-DCMAKE_CXX_FLAGS="$FLAGS" \
-DCMAKE_C_FLAGS="$FLAGS" \
-DCMAKE_Fortran_FLAGS="$FLAGS" \
-DCMAKE_INSTALL_PREFIX=$LIBDIR \
-DCMAKE_MAKE_PROGRAM="make" \
-DTrilinos_ENABLE_NOX=ON \
-DNOX_ENABLE_LOCA=ON \
-DTrilinos_ENABLE_EpetraExt=ON \
-DEpetraExt_BUILD_BTF=ON \
-DEpetraExt_BUILD_EXPERIMENTAL=ON \
-DEpetraExt_BUILD_GRAPH_REORDERINGS=ON \
-DTrilinos_ENABLE_TrilinosCouplings=ON \
-DTrilinos_ENABLE_Ifpack=ON \
-DTrilinos_ENABLE_Isorropia=ON \
-DTrilinos_ENABLE_AztecOO=ON \
-DTrilinos_ENABLE_Belos=ON \
-DTrilinos_ENABLE_Teuchos=ON \
-DTeuchos_ENABLE_COMPLEX=ON \
-DTrilinos_ENABLE_Amesos=ON \
-DAmesos_ENABLE_KLU=ON \
-DTrilinos_ENABLE_Sacado=ON \
-DTrilinos_ENABLE_Kokkos=OFF \
-DTrilinos_ENABLE_ALL_OPTIONAL_PACKAGES=OFF \
-DTrilinos_ENABLE_CXX11=ON \
-DTPL_ENABLE_AMD=ON \
-DAMD_LIBRARY_DIRS="/usr/lib" \
-DTPL_AMD_INCLUDE_DIRS="/usr/include/suitesparse" \
-DTPL_ENABLE_BLAS=ON \
-DTPL_ENABLE_LAPACK=ON \
$SRCDIR
make
sudo mkdir -p $LIBDIR
sudo make install
###########################################################################
#Install Xyce from Source
###########################################################################
#Clone Xyce
git clone git@github.com:Xyce/Xyce.git
#Build Xyce
cd Xyce
./bootstrap
./configure CXXFLAGS="-O3 -std=c++11" ARCHDIR=$LIBDIR --prefix=$INSTALLDIR CPPFLAGS="-I/usr/include/suitesparse"
make
sudo mkdir -p $INSTALLDIR
sudo make install
#Test installation
$INSTALLDIR/bin/Xyce |
Beta Was this translation helpful? Give feedback.
-
The reason is that there is NOT "one correct way to do it." The configure script is extraordinarily flexible and allows for all sorts of ridiculous permutations of system configuration. We provide guidance on a recommended way to do it that keeps everything consistent, and if that guidance is followed then things are easy. If the user knows better and wants to do something else, the capability is there. A big problem here is that there are so many ways to compile Trilinos, and their default build is not suited to use with Xyce. It is difficult for autoconf to pick up how Trilinos is compiled (although we try pretty hard to detect it and give a minimum of dials that have to be set just right). But if one doesn't tell Xyce's configure where to look for Trilinos's libraries and headers, then it has no way of finding them. Once it finds them, it does as best it can to detect what components of the Trilinos install are needed and whether they will work. |
Beta Was this translation helpful? Give feedback.
-
I'm following similar instructions where I put the ARCHDIR in /software/XyceLibs/Parallel. I've compiled Trilinos with all of the parallel enables from the suggestions in Xyce Trilinos install instructions (including Amesos_ENABLE_KLU), but when I run Xyce configure I get: They are very clearly in /software/XyceLibs/Parallel/include. (I'm building Xyce in a separate directory as suggested...) |
Beta Was this translation helpful? Give feedback.
-
Oops, that was a cut & paste error -- I'm not redefining the prefix.
…On Thu, Mar 4, 2021 at 10:42 AM Tom Russo ***@***.***> wrote:
The "prefix" should only be specified once on the configure line. It looks
like you are setting it twice, and the second one should instead be
CPPFLAGS="-I/usr/include/suitesparse" . "prefix" is just supposed to be the
directory where Xyce will be installed.
Well spotted, I'd missed that. By not putting -I/usr/include/suitesparse
into CPPFLAGS, it could be that the test compile of the file that includes
"Amesos_Klu.h" is failing to find some suitesparse header it needs. I am
not entirely sure *which* suitesparse header that would be, but it's
possible. Even if that's not the source of the "KLU headers not found"
problem, it will cause other problems and should be fixed before digging
further.
The config.log file would be the real clue as to what's going on, though.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#4 (reply in thread)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AC67SL4ESRMXCGQO4B77SSTTB7ICDANCNFSM4YTYMXCQ>
.
--
Matthew Guthaus
Associate Dean of Graduate Studies
Professor, Computer Science & Engineering
Baskin School of Engineering
University of California Santa Cruz
https://www.soe.ucsc.edu/people/mrg
|
Beta Was this translation helpful? Give feedback.
-
(I tried attaching it but it didn't go through...)
It seems that it isn't finding mpi.h actually. I have openmpi and the dev
libraries installed so I'll explicitly add some configure paths to those in
the configure arguments.
…On Thu, Mar 4, 2021 at 10:49 AM Tom Russo ***@***.***> wrote:
Then the real key to what's going on will be found in your config.log
file, down where configure compiles a small test program that includes
Amesos_Klu.h. That compile is failing, and probably not because
Amesos_Klu.h doesn't exist. Find that reason, and you'll be on your way.
If you can't find that, attach your config.log file and I can probably
spot it quickly.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#4 (reply in thread)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AC67SLYMGTQ7FLYKSILIE63TB7I5LANCNFSM4YTYMXCQ>
.
--
Matthew Guthaus
Associate Dean of Graduate Studies
Professor, Computer Science & Engineering
Baskin School of Engineering
University of California Santa Cruz
https://www.soe.ucsc.edu/people/mrg
|
Beta Was this translation helpful? Give feedback.
-
That was another cut & paste error.
If I add an include path explicitly to where mpi.h is and I add
"--enable-mpi" to the configure line it seem to make it further...
…On Thu, Mar 4, 2021 at 10:52 AM Tom Russo ***@***.***> wrote:
AH! Unless this is another cut-and-paste error, you've got "--std=c++1" in
your CXXFLAGS rather than "--std=c++11".
On the current master branch, configure figures out for itself how to get
C++11 support, so you could leave this out entirely (the documentation in
the building guide is only updated at release time, so it hasn't yet been
changed to reflect this improvement in configure). But specifying
"--std=c++1" could probably mess things up.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#4 (reply in thread)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AC67SL6AKHD7TC274E6MDBLTB7JG5ANCNFSM4YTYMXCQ>
.
--
Matthew Guthaus
Associate Dean of Graduate Studies
Professor, Computer Science & Engineering
Baskin School of Engineering
University of California Santa Cruz
https://www.soe.ucsc.edu/people/mrg
|
Beta Was this translation helpful? Give feedback.
-
It works without doing that and specifying the enable mpi and wrappers. It
wasn't clear that I needed to do that at first.
…On Thu, Mar 4, 2021 at 11:01 AM Tom Russo ***@***.***> wrote:
You should NOT need to specify a path to where mpi.h is, and should not.
This is a sign that you are not using the correct compiler wrappers as CC
and CXX.
If you look again at
https://xyce.sandia.gov/documentation/BuildingGuide.html#parallelBuilds
you'll see that all of our guidance tells you to do that.
If you use the compiler wrappers that MPI provides, you'll get those paths
automatically.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#4 (reply in thread)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AC67SL25YLMYZXONPWX7TETTB7KJBANCNFSM4YTYMXCQ>
.
--
Matthew Guthaus
Associate Dean of Graduate Studies
Professor, Computer Science & Engineering
Baskin School of Engineering
University of California Santa Cruz
https://www.soe.ucsc.edu/people/mrg
|
Beta Was this translation helpful? Give feedback.
-
I did compile a while ago on 18.04 (IRRC). I just compiled on Ubuntu 22.04. I have also been trying to compile dakota so some of my chnages are due to desire to be able to build dakota against trilinos as well, and with shared libraries. So this setup may or may not be useful, as I am experimenting a bit.
Here is my config command:
I did make this change to get it to compile with -std=gnu++20:
*xyce xyce commit: 1b7c261 config command:
[EDIT: After reversing this, I found it is not needed. So, one of the changes I made on the path to completion resolved this issue.] And I did this hack to get around an error about finding a matching signature for the call to DeviceCountMapSum().
|
Beta Was this translation helpful? Give feedback.
Please review the building guide's instructions about ARCHDIR.
You are installing your Trilinos libraries into $HOME/XyceLibs/Serial, but are giving a completely different ARCHDIR to Xyce's configure script. They should be the same.
From the building guide: