# Cannot compile ccx\_2.17 with PaStiX

**URL:** <https://calculix.discourse.group/t/cannot-compile-ccx-2-17-with-pastix/288>\
**Category:** Uncategorized\
**Created:** [November 7, 2020, 11:14pm UTC](https://calculix.discourse.group/t/cannot-compile-ccx-2-17-with-pastix/288 "2020-11-07T23:14:40Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![kmallick](https://avatars.discourse-cdn.com/v4/letter/k/85e7bf/32.png) [@kmallick](https://calculix.discourse.group/u/kmallick)\
**Post date:** [November 7, 2020, 11:14pm UTC](https://calculix.discourse.group/t/cannot-compile-ccx-2-17-with-pastix/288/1 "2020-11-07T23:14:40Z")

</div>

I need some help. I am using stock source of ccx 2.17 and following README to compile in Ubuntu 20.04. I have gone though all the steps to make OpenBLAS, hwloc, parsec, scotch and pastix. Ihave installed CUDA 11.1 and modified the make files as needed. When I run Makefile\_i8 I get the following error:

/usr/bin/ld: …/…/…/PaStiX/pastix\_i8/lib/libpastix.a(isched\_hwloc.c.o): undefined reference to symbol ‘hwloc\_bitmap\_iszero’  
/usr/bin/ld: …/…/…/PaStiX/hwloc\_i8/lib/libhwloc.so: error adding symbols: DSO missing from command line  
collect2: error: ld returned 1 exit status  
make: \*\*\* [Makefile\_i8:39: ccx\_2.17\_i8] Error 1

Any idea what could be the issue here? I see that in my case hwloc creates a lib folder and not a lib64. I have modified the Makefile accordingly.

---

<div class="post-metadata">

**Author:** ![osmanfb](https://avatars.discourse-cdn.com/v4/letter/o/65b543/32.png) [@osmanfb](https://calculix.discourse.group/u/osmanfb)\
**Post date:** [November 9, 2020, 4:59pm UTC](https://calculix.discourse.group/t/cannot-compile-ccx-2-17-with-pastix/288/2 "2020-11-09T16:59:10Z")

</div>

DSO is dynamic shared object add -lpthread to the link command in the makefile.

---

<div class="post-metadata">

**Author:** ![kmallick](https://avatars.discourse-cdn.com/v4/letter/k/85e7bf/32.png) [@kmallick](https://calculix.discourse.group/u/kmallick)\
**Post date:** [November 10, 2020, 4:44am UTC](https://calculix.discourse.group/t/cannot-compile-ccx-2-17-with-pastix/288/3 "2020-11-10T04:44:13Z")

</div>

Thanks. I believe -lpthread is already in the link command. Below is my exact Makefile\_i8 file, slightly modded from the stock file based on my system. Would really appreciate some suggestions.

CFLAGS = -Wall -O2 -fopenmp -fpic -I …/…/…/SPOOLES.2.2 -I$(PASTIX\_INCLUDE) -DARCH=“Linux” -DSPOOLES -DARPACK -DMATRIXSTORAGE -DLONGLONG -DPASTIX -DPASTIX\_FP32 -DPASTIX\_GPU  
FFLAGS = -Wall -O2 -fopenmp -fpic -fdefault-integer-8

CC=cc  
FC=gfortran

.c.o :  
(CC) (CFLAGS) -c \< .f.o : (FC) (FFLAGS) -c \<

include Makefile.inc

SCCXMAIN = ccx\_2.17.c

OCCXF = (SCCXF:.f=.o) OCCXC = (SCCXC:.c=.o)  
OCCXMAIN = $(SCCXMAIN:.c=.o)

DIR=…/…/…/SPOOLES.2.2

PASTIX\_INCLUDE = …/…/…/PaStiX/pastix\_i8/include  
PASTIX\_LIBS = …/…/…/PaStiX/hwloc\_i8/lib/libhwloc.so …/…/…/OpenBLAS\_i8/lib/libopenblas.a   
…/…/…/PaStiX/pastix\_i8/lib/libpastix.a …/…/…/OpenBLAS\_i8/lib/libopenblas.a -lpthread -lm …/…/…/PaStiX/pastix\_i8/lib/libspm.a   
…/…/…/PaStiX/pastix\_i8/lib/libpastix\_parsec.a …/…/…/PaStiX/pastix\_i8/lib/libpastix\_kernels.a …/…/…/OpenBLAS\_i8/lib/libopenblas.a -lrt   
…/…/…/PaStiX/pastix\_i8/lib/libpastix\_kernels\_cuda.a …/…/…/PaStiX/parsec\_i8/lib/libparsec.so   
/usr/local/cuda-11.1/lib64/libcudart\_static.a -lpthread -ldl -lrt /usr/lib/x86\_64-linux-gnu/libcublas.so.10   
/usr/local/cuda-11.1/lib64/libculibos.a /usr/lib/x86\_64-linux-gnu/libcublasLt.so.10 -lrt   
…/…/…/PaStiX/scotch\_i8/lib/libscotch.a …/…/…/PaStiX/scotch\_i8/lib/libscotcherrexit.a -lpthread -lz -lm /usr/lib/x86\_64-linux-gnu/libstdc++.so.6 /usr/lib/x86\_64-linux-gnu/libgomp.so.1

LIBS =   
(DIR)/spooles.a \ ../../../ARPACK/libarpack\_INTEL.a \ (PASTIX\_LIBS)   
-lpthread -lm -lc

ccx\_2.17\_i8: (OCCXMAIN) ccx\_2.17.a (LIBS)  
./date.pl; (CC) (CFLAGS) -c ccx\_2.17.c; (FC) -Wall -O2 -o @   
(OCCXMAIN) ccx\_2.17.a (LIBS)

ccx\_2.17.a: (OCCXF) (OCCXC)  
ar vr @ ?

---

<div class="post-metadata">

**Author:** ![kmallick](https://avatars.discourse-cdn.com/v4/letter/k/85e7bf/32.png) [@kmallick](https://calculix.discourse.group/u/kmallick)\
**Post date:** [November 12, 2020, 5:57am UTC](https://calculix.discourse.group/t/cannot-compile-ccx-2-17-with-pastix/288/4 "2020-11-12T05:57:24Z")

</div>

I was finally able to compile ccx with PastiX in Ubuntu 20.04. I had to modify the following line in Makefile\_i8 file, by adding …/…/…/PaStiX/hwloc\_i8/lib/libhwloc.so to the end. Hope this helps someone.

ccx\_2.17\_i8: (OCCXMAIN) ccx\_2.17.a (LIBS)  
./date.pl; (CC) (CFLAGS) -c ccx\_2.17.c; (FC) -Wall -O2 -o @   
(OCCXMAIN) ccx\_2.17.a (LIBS) …/…/…/PaStiX/hwloc\_i8/lib/libhwloc.so

---

<div class="post-metadata">

**Author:** ![rafal.brzegowy](https://avatars.discourse-cdn.com/v4/letter/r/a9adbd/32.png) [@rafal.brzegowy](https://calculix.discourse.group/u/rafal.brzegowy)\
**Post date:** [November 12, 2020, 7:17am UTC](https://calculix.discourse.group/t/cannot-compile-ccx-2-17-with-pastix/288/5 "2020-11-12T07:17:32Z")

</div>

For Ubuntu system, you can use a ready-made hwloc and scotch package (to facilitate the entire procedure):  
sudo apt-get install -y hwloc  
sudo apt-get install -y scotch
