Skip to content

Commit

Permalink
Add Xyce to image (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
sgherbst authored Mar 7, 2024
1 parent 6dca104 commit a81ceb7
Show file tree
Hide file tree
Showing 3 changed files with 117 additions and 3 deletions.
60 changes: 57 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@

FROM python:3.11

# copy in reconfiguration files
COPY reconfigure-trilinos /root/reconfigure-trilinos
COPY reconfigure-xyce /root/reconfigure-xyce

# basic setup, including Python and Node.js installations
# (Node.js is needed for some GitHub Actions)
RUN \
Expand All @@ -19,13 +23,62 @@ rm -rf /var/lib/apt/lists/*
# install verible. Move executables to a location on PATH and remove
# downloaded files.
RUN \
apt-get update && apt-get install -y wget && \
apt-get update -y && \
apt-get install -y wget && \
wget https://github.com/chipsalliance/verible/releases/download/v0.0-3303-gd87f2420/verible-v0.0-3303-gd87f2420-linux-static-x86_64.tar.gz && \
tar xzf verible-v*.tar.gz && \
rm verible-v*.tar.gz && \
mv verible-v* verible && \
cp -a verible/bin/* /usr/local/bin && \
rm -rf verible
rm -rf verible && \
apt clean && \
rm -rf /var/lib/apt/lists/*

# install prereqs for Xyce
RUN \
apt update -y && \
apt install -y gcc g++ gfortran make cmake bison flex libfl-dev \
libfftw3-dev libsuitesparse-dev libblas-dev liblapack-dev libtool \
autoconf automake git && \
apt clean && \
rm -rf /var/lib/apt/lists/*

# install Trilinos
RUN \
cd /root && \
mkdir Trilinos12.12 && \
cd Trilinos12.12 && \
wget https://github.com/trilinos/Trilinos/archive/refs/tags/trilinos-release-12-12-1.tar.gz && \
tar xzf trilinos-release-12-12-1.tar.gz && \
rm trilinos-release-12-12-1.tar.gz && \
mkdir -p /root/XyceLibs/Serial && \
cd Trilinos-trilinos-release-12-12-1 && \
mkdir -p build && \
cd build && \
mv /root/reconfigure-trilinos reconfigure && \
chmod u+x reconfigure && \
./reconfigure && \
make && \
make install && \
cd /root && \
rm -rf Trilinos12.12

# install Xyce
RUN \
cd /root && \
wget https://xyce.sandia.gov/files/xyce/Xyce-7.8.tar.gz && \
tar xzf Xyce-7.8.tar.gz && \
rm Xyce-7.8.tar.gz && \
cd Xyce-7.8 && \
mkdir -p build && \
cd build && \
mv /root/reconfigure-xyce reconfigure && \
chmod u+x reconfigure && \
./reconfigure && \
make && \
make install && \
cd /root && \
rm -rf Xyce-7.8

# install Verilator. the final remove in the same RUN command
# is important to keep the docker image size low
Expand Down Expand Up @@ -69,4 +122,5 @@ apt clean && \
rm -rf /var/lib/apt/lists/*

# set environment
ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \
LD_LIBRARY_PATH=/usr/local/lib
44 changes: 44 additions & 0 deletions reconfigure-trilinos
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/bin/sh

SRCDIR=/root/Trilinos12.12/Trilinos-trilinos-release-12-12-1
ARCHDIR=/root/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_AztecOO=ON \
-DTrilinos_ENABLE_Belos=ON \
-DTrilinos_ENABLE_Teuchos=ON \
-DTrilinos_ENABLE_COMPLEX_DOUBLE=ON \
-DTrilinos_ENABLE_Amesos=ON \
-DAmesos_ENABLE_KLU=ON \
-DTrilinos_ENABLE_Amesos2=ON \
-DAmesos2_ENABLE_KLU2=ON \
-DAmesos2_ENABLE_Basker=ON \
-DTrilinos_ENABLE_Sacado=ON \
-DTrilinos_ENABLE_Stokhos=ON \
-DTrilinos_ENABLE_Kokkos=ON \
-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
16 changes: 16 additions & 0 deletions reconfigure-xyce
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/sh

SRCDIR=/root/Xyce-7.8
ARCHDIR=/root/XyceLibs/Serial

$SRCDIR/configure \
ARCHDIR=$ARCHDIR \
--disable-verbose_linear \
--disable-verbose_nonlinear \
--disable-verbose_time \
--enable-shared \
--enable-xyce-shareable \
CC=gcc \
CXX=g++ \
F77=gfortran \
CXXFLAGS="-O1 -fno-inline -std=c++11"

0 comments on commit a81ceb7

Please sign in to comment.