Build ccx with arpack-ng

Greetings.

I am trying to build ccx_2.20 on ubuntu 20.04 on docker. The arpack version suggested in the official install guide () is not available anymore. I am trying to install it with the opencollab version of arpack, arpack-ng but I am receiving an error when I try to build ccx.
This is my Dockerfile

FROM ubuntu:20.04
ENV DEBIAN_FRONTEND=noninteractive 
ENV LANG C.UTF-8

RUN apt-get update && apt-get install -y \
    wget \
    gfortran \
    make \
    git \
    autoconf \
    f2c \
    openmpi-bin openmpi-doc libopenmpi-dev\
    libtool\
    liblapack3 \
    liblapack-dev \
    libexodusii-dev \
    libgl1-mesa-dev \
    libglu1-mesa-dev \
    libxi-dev libxmu-dev

RUN apt install -y libgfortran4

RUN mkdir /usr/local/SPOOLES.2.2
WORKDIR /usr/local/SPOOLES.2.2
RUN wget http://www.netlib.org/linalg/spooles/spooles.2.2.tgz && tar xvf spooles.2.2.tgz
RUN sed -i 's@  CC = /usr/lang-4.0/bin/cc@# CC = /usr/lang-4.0/bin/cc@g' Make.inc
RUN sed -i 's@# CC = gcc@  CC = gcc@g' Make.inc
RUN make lib
WORKDIR /usr/local/SPOOLES.2.2/MT/src/
RUN make

RUN mkdir /tmp/ARPACK
WORKDIR /tmp/ARPACK
ENV OMPI_ALLOW_RUN_AS_ROOT=1
ENV OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1
RUN git clone https://github.com/opencollab/arpack-ng.git
WORKDIR /tmp/ARPACK/arpack-ng
RUN sh bootstrap
RUN ./configure --enable-mpi
RUN make
RUN make check
RUN make install

WORKDIR /usr/local
RUN wget http://www.dhondt.de/ccx_2.20.src.tar.bz2
RUN tar -xvjf ccx_2.20.src.tar.bz2
WORKDIR /usr/local/CalculiX/ccx_2.20/src
RUN mv Makefile Makefile_ST
RUN mv Makefile_MT Makefile
RUN sed -i 's@ ../../../ARPACK/libarpack_INTEL.a@ /usr/local/lib/libarpack.so@g' Makefile

WORKDIR /root/shared

This is the error I receive


### Errors with LIBS =  /usr/local/lib/libarpack.so
./date.pl; cc -Wall -O2  -I ../../../SPOOLES.2.2 -DARCH="Linux" -DSPOOLES -DARPACK -DMATRIXSTORAGE -DNETWORKOUT -c ccx_2.20.c; gfortran  -Wall -O2 -o ccx_2.20 ccx_2.20.o ccx_2.20.a ../../../SPOOLES.2.2/spooles.a /usr/local/lib/libarpack.so -lpthread -lm -lc -fopenmp
Can't open ccx_2.20step.c: No such file or directory at ./date.pl line 18.
ccx_2.20.c: In function ‘main’:
ccx_2.20.c:1766:18: warning: ‘nkon0’ may be used uninitialized in this function [-Wmaybe-uninitialized]
 1766 |       ne=ne0;nkon=nkon0;
      |              ~~~~^~~~~~
In file included from ccx_2.20.c:30:
CalculiX.h:62:29: warning: ‘ne0’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   62 | #define RENEW(a,b,c) a=(b *)u_realloc((b *)(a),(c)*sizeof(b),__FILE__,__LINE__,#a)
      |                             ^~~~~~~~~
ccx_2.20.c:72:39: note: ‘ne0’ was declared here
   72 |     iprestr,kode,isolver,nslavs,nkon_,ne0,nkon0,mortar,
      |                                       ^~~
ccx_2.20.c:63:22: warning: ‘nxstate’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   63 |     *ipoinpc=NULL,mt,nxstate,nload0,iload,*iuel=NULL,*ne2boun=NULL,
      |                      ^~~~~~~
/usr/bin/ld: ccx_2.20.a(dsptrf.o): undefined reference to symbol 'dlaev2_'
/usr/bin/ld: /lib/x86_64-linux-gnu/liblapack.so.3: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make: *** [Makefile:29: ccx_2.20] Error 1

Has anyone build ccx with arpack-ng? Please let me know what is wrong in my build.

the version recommended in the official instructions can be recovered from the wayback machine: ARPACK - Arnoldi Package

3 Likes

It seems like it would be a good idea for CCX to migrate to ARPACK-NG, since it is being supported by volunteers and the original was abandoned. Or ditch ARPACK altogether and use something more modern, if possible.

Anthony

1 Like

That worked. Thanks!!

On FreeBSD, CalculiX is successfully built with arpack-ng.

In this case, the linker is complaining about a missing function dlaev2_, which is part of lapack.

The Makefile in the src directory should contain the following libraries:

LIBS = \
       -lspooles -larpack -lblas -llapack \
       -lpthread -lm
1 Like

Or maybe try this:

-lspooles $(shell pkg-config --libs --static arpack) \

1 Like