Which version of Trilinos is recommended for compiling Xyce 7.9

40 views
Skip to first unread message

weiji

unread,
May 16, 2025, 2:45:22 AMMay 16
to xyce-users
Which version of Trilinos is recommended for compiling Xyce 7.9, and what is the minimum version that can be used?
The INSTALL.md file seems to recommend using Trilinos version 14.4, but this version requires enabling C++17 support, which in turn requires GCC 8 or later.
However, the release notes mention support for GCC 4.9. Which version of Trilinos corresponds to GCC 4.9 support?
Appreciate any help—thanks!

Thomas Russo

unread,
May 17, 2025, 9:24:09 AMMay 17
to xyce-users
INSTALL.md and the website building guide document completely different build processess, and the requirements of each are completely different.  The release notes references to required tools is part of a boilerplate that may or may not get updated with every release.   The release notes claim that GCC 4.9 is the minimum version is based on the long-standing assumption that users will build using the building guide's process.

The building guide documents building Xyce using autotools, the configure system that has been in place in Xyce since about 2001.   After Trilinos 12.12.1, the Trilinos team made changes to the Trilinos build process that makes it very difficult to get Xyce's autotools process right (it is still possible to use it with later versions of trilinos, but is too fiddly to recommend).  This is why the building guide continues to insist that you build the very old Trilinos 12.12.1, because that is the last version of Trilinos that is guaranteed to work with the autotools process.  Trilinos 12.12.1 could be built with GCC 4.9, because all it needed was C++11.

INSTALL.md documents the new CMake process, which interoperates with Trilinos much more cleanly.   The document is slightly out of date because it continues to recommend building Trilinos 14.4.  Trilinos 16.1 is already out and in my own experience works just fine with Xyce's cmake build process.  As you note, this means using much more recent versions of GCC because Trilinos now requires C++17.

The team is very deliberately moving forward on deprecating and removing the very old "autotools" build process documented in the website building guide.   INSTALL.md documents the new, but not yet finalized, cmake procedure that can work with later versions of Trilinos such as 14.4.   These later versions of Trilinos need C++17 and, as you note, require GCC 8 and later.

The presence of two completely different build processes with documentation in two different places is confusing, but was necessary because the CMake build process took so very long to get right.  While it was under development it was somewhat unstable, and so having the very stable (but clunky) autotools build continue to work was necessary.

It is my understanding that the upcoming Xyce 7.10 release will be the last one that supports autotools at all, and that the CMake process is basically ready to roll out officially with that release.  Xyce 7.11 will, as I am told, no longer have an autotools build and will only be buildable using cmake.   Hopefully the INSTALL.md document will be brought up to date before the 7.10 release.  It still reads as something of a work in progress rather than solid guidance for users.

Stefan Schippers

unread,
May 17, 2025, 5:10:56 PMMay 17
to Thomas Russo, xyce-users
Just for info I also realized that latest Xyce has a new 'cmake' based build system.

These are the steps I did to successfully install latest (from git master)
Xyce on my Debian-testing (thus quite recent and up to date) system.
I guess it should be valid for (recent) Ubuntu systems as well.

In the example below I am installing trilinos (14-4-0) in ${HOME}/XyceLibs/Serial and
Xyce in ${HOME}/xyce.
If you want to install in different places change these paths.
Source directories are in /mnt/sda7/trilinos_git and /mnt/sda7/Xyce_git.
Of course change these paths according to your locations.
I am assuming you have all the dependencies installed (libsuitesparse, libfftw3,
cmake, bison, flex, libblas, liblapack and the corresponding *-dev packages):

I had to add this variable to trilinos cmake configuration:
-D AMD_INCLUDE_DIRS=/usr/include/suitesparse
as it did not figure out the location of these header files.

#### NEW INSTRUCTIONS for Xyce 7.9+ ####
## Xyce will be installed in ${HOME}/xyce
## Trilinos will be installed in ${HOME}/XyceLibs/Serial

## get Trilinos and build (Serial):
git clone https://github.com/trilinos/trilinos trilinos_git
git checkout trilinos-release-14-4-0
mkdir build
cd build
cmake -C /mnt/sda7/Xyce_git/cmake/trilinos/trilinos-base.cmake \
/mnt/sda7/trilinos_git \
-D CMAKE_INSTALL_PREFIX=$HOME/XyceLibs/Serial \
-D AMD_INCLUDE_DIRS=/usr/include/suitesparse
cmake --build . -j 4 -t install

## get Xyce and build:
git clone https://github.com/Xyce/Xyce.git Xyce_git
cd Xyce_git
mkdir build
cd build
cmake -D Xyce_PLUGIN_SUPPORT=ON \
-D CMAKE_INSTALL_PREFIX=$HOME/xyce \
-D Trilinos_ROOT=$HOME/XyceLibs/Serial \
/mnt/sda7/Xyce_git
cmake --build . -j 4 -t install

Stefan


On 5/17/25 15:24, Thomas Russo wrote:
> INSTALL.md and the website building guide document completely different build processess, and the requirements of each are completely different.  The release notes references to required tools is part of a boilerplate that may or may not get updated with every release.   The release notes claim that GCC 4.9 is the minimum version is based on the long-standing assumption that users will build using the building guide's process.
>
> The building guide documents building Xyce using autotools, the configure system that has been in place in Xyce since about 2001.   After Trilinos 12.12.1, the Trilinos team made changes to the Trilinos build process that makes it very difficult to get Xyce's autotools process right (it is still possible to use it with later versions of trilinos, but is too fiddly to recommend).  This is why the building guide continues to insist that you build the very old Trilinos 12.12.1, because that is the last version of Trilinos that is guaranteed to work with the autotools process.  Trilinos 12.12.1 could be built with GCC 4.9, because all it needed was C++11.
>
> INSTALL.md documents the new CMake process, which interoperates with Trilinos much more cleanly.   The document is slightly out of date because it continues to recommend building Trilinos 14.4.  Trilinos 16.1 is already out and in my own experience works just fine with Xyce's cmake build process.  As you note, this means using much more recent versions of GCC because Trilinos now requires C++17.
>
> The team is very deliberately moving forward on deprecating and removing the very old "autotools" build process documented in the website building guide.   INSTALL.md documents the new, but not yet finalized, cmake procedure that can work with later versions of Trilinos such as 14.4.   These later versions of Trilinos need C++17 and, as you note, require GCC 8 and later.
>
> The presence of two completely different build processes with documentation in two different places is confusing, but was necessary because the CMake build process took so very long to get right.  While it was under development it was somewhat unstable, and so having the very stable (but clunky) autotools build continue to work was necessary.
>
> It is my understanding that the upcoming Xyce 7.10 release will be the last one that supports autotools at all, and that the CMake process is basically ready to roll out officially with that release.  Xyce 7.11 will, as I am told, no longer have an autotools build and will /only/ be buildable using cmake.   Hopefully the INSTALL.md document will be brought up to date before the 7.10 release.  It still reads as something of a work in progress rather than solid guidance for users.
>
> On Friday, May 16, 2025 at 12:45:22 AM UTC-6 weiji wrote:
>
> *Which version of Trilinos is recommended for compiling Xyce 7.9, and what is the minimum version that can be used?*
> The INSTALL.md file seems to recommend using Trilinos version 14.4, but this version requires enabling C++17 support, which in turn requires GCC 8 or later.
> However, the release notes mention support for GCC 4.9. Which version of Trilinos corresponds to GCC 4.9 support?
> Appreciate any help—thanks!
>
> --
> You received this message because you are subscribed to the Google Groups "xyce-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to xyce-users+...@googlegroups.com <mailto:xyce-users+...@googlegroups.com>.
> To view this discussion visit https://groups.google.com/d/msgid/xyce-users/bf5d9a65-0395-4c60-9793-c79054cc2c2dn%40googlegroups.com <https://groups.google.com/d/msgid/xyce-users/bf5d9a65-0395-4c60-9793-c79054cc2c2dn%40googlegroups.com?utm_medium=email&utm_source=footer>.

Thomas Russo

unread,
May 18, 2025, 12:23:49 AMMay 18
to xyce-users
Yes, there are many little things that need to be handled specially on a system-by-system basis.  

On my system, for example, Clang 19 is the default compiler, and it turns out that Trilinos 14.4 has a bug that trips up that version of the compiler.  As a result, I have to build the lastest Trilinos release (16.1.0) in which that bug is fixed, or use an older Clang.   And *that* version of Trilinos makes use of the backtrace functions that my system puts in libexecinfo and would not otherwise be found by cmake (Linux puts those backtrace functions into libc and so they're available automatically).  So I have extra hoops to jump through to make sure all Trilinos shared libraries wind up with -lexecinfo forced into their dependencies:

Build Trilinos:

pushd ~/Xyce/trilinos       # already git cloned and up-to-date
git checkout trilinos-release-16-1-0
popd

LDFLAGS=-lexecinfo
cmake -C ~/Xyce/Xyce/cmake/trilinos/trilinos-base.cmake \
~/Xyce/trilinos \
-DBUILD_SHARED_LIBS:BOOL=ON \
-DCMAKE_INSTALL_PREFIX=/users/russo/XyceLibs/FreeBSD13_trilinos16.1.0 \
-DCMAKE_Fortran_COMPILER=gfortran13 \
-DCMAKE_EXE_LINKER_FLAGS:STRING="${LDFLAGS}" \
-DCMAKE_MODULE_LINKER_FLAGS:STRING="${LDFLAGS}" \
-DCMAKE_SHARED_LINKER_FLAGS:STRING="${LDFLAGS}" \
-DAMD_INCLUDE_DIRS=/usr/local/include/suitesparse

cmake --build . -j 8 --target install

And to build Xyce:

pushd ../Xyce
git checkout master
popd

PATH=$PATH:/usr/local/XDM/bin
TRILINOS_ROOT=/users/russo/XyceLibs/FreeBSD13_trilinos16.1.0
cmake  \
-DBUILD_TESTING=ON \
-DXyce_GTEST_UNIT_TESTS=ON \
-DXyce_PLUGIN_SUPPORT=ON \
-DBUILD_SHARED_LIBS=ON \
-DCMAKE_INSTALL_PREFIX=/users/russo/XyceInstalls/Xyce_Serial_t16.1 \
-DTrilinos_ROOT=$TRILINOS_ROOT \
-DCMAKE_Fortran_COMPILER=gfortran13 \
-DCMAKE_EXE_LINKER_FLAGS="-Wl,-rpath,$TRILINOS_ROOT/lib" \
-DXyce_REGRESSION_DIR=/users/russo/Xyce/Xyce_Regression \
../Xyce

cmake --build . -j 8 --target all

All this necessary to make Xyce use Trilinos shared libraries from an unusual install location (in my home directory) and continue to work after installed, and to make the CTest configuration find the Xyce regression suite for testing knowing it can test the XDM tool, too:
ctest -j8 -L "nightly" -LE "required:pymi"


Every system's going to be a little different depending on how you want the thing to work.  If I hadn't built Trilnos as shared libraries and forced "-lexecinfo" into its dependencies when Trilinos was build, I'd have had to force it into *Xyce's* linker flags, even though Xyce itself doesn't use backtrace or execinfo.  

The CMake build system for Xyce has been under development for years now, and getting it to work properly has been critical in allowing the team to press on with other urgent development related to Trilinos advancements.

No matter how you slice it, building Xyce is always going to take some work and it's always going to be necessary to give the build system some hints about your system that it won't divine for itself.
Reply all
Reply to author
Forward
0 new messages