Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to build #4

Open
Wang-Yu-Qing opened this issue Jul 8, 2021 · 11 comments
Open

Failed to build #4

Wang-Yu-Qing opened this issue Jul 8, 2021 · 11 comments

Comments

@Wang-Yu-Qing
Copy link

Wang-Yu-Qing commented Jul 8, 2021

Version:

  • CentOS Linux release 7.4.1708 (Core)
  • gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-39)
$ git clone --branch dgl https://github.com/KarypisLab/ParMETIS.git
$ cd ParMETIS
$ make config cc=mpicc prefix=~/local
rm -rf build/Linux-x86_64
mkdir -p build/Linux-x86_64
cd build/Linux-x86_64 && cmake /home/xxx/ParMETIS -DCMAKE_VERBOSE_MAKEFILE=1 -DGKLIB_PATH=/home/xxx/ParMETIS/~/local  -DMETIS_PATH=/home/xxx/ParMETIS/~/local -DCMAKE_INSTALL_PREFIX=/root/local -DCMAKE_C_COMPILER=mpicc
-- The C compiler identification is GNU 4.8.5
-- Check for working C compiler: /usr/lib64/mpich-3.2/bin/mpicc
-- Check for working C compiler: /usr/lib64/mpich-3.2/bin/mpicc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Looking for execinfo.h
-- Looking for execinfo.h - found
-- Looking for getline
-- Looking for getline - found
-- Configuring done
-- Generating done
-- Build files have been written to: /home/xxx/ParMETIS/build/Linux-x86_64

$ make install

And I get:

make[1]: Entering directory `/home/xxx/ParMETIS/build/Linux-x86_64'
/usr/bin/cmake -H/home/xxx/ParMETIS -B/home/xxx/ParMETIS/build/Linux-x86_64 --check-build-system CMakeFiles/Makefile.cmake 0
/usr/bin/cmake -E cmake_progress_start /home/xxx/ParMETIS/build/Linux-x86_64/CMakeFiles /home/xxx/ParMETIS/build/Linux-x86_64/CMakeFiles/progress.marks
make -f CMakeFiles/Makefile2 all
make[2]: Entering directory `/home/xxx/ParMETIS/build/Linux-x86_64'
make -f libparmetis/CMakeFiles/parmetis.dir/build.make libparmetis/CMakeFiles/parmetis.dir/depend
make[3]: Entering directory `/home/xxx/ParMETIS/build/Linux-x86_64'
cd /home/xxx/ParMETIS/build/Linux-x86_64 && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/xxx/ParMETIS /home/xxx/ParMETIS/libparmetis /home/xxx/ParMETIS/build/Linux-x86_64 /home/xxx/ParMETIS/build/Linux-x86_64/libparmetis /home/xxx/ParMETIS/build/Linux-x86_64/libparmetis/CMakeFiles/parmetis.dir/DependInfo.cmake --color=
Scanning dependencies of target parmetis
make[3]: Leaving directory `/home/xxx/ParMETIS/build/Linux-x86_64'
make -f libparmetis/CMakeFiles/parmetis.dir/build.make libparmetis/CMakeFiles/parmetis.dir/build
make[3]: Entering directory `/home/xxx/ParMETIS/build/Linux-x86_64'
/usr/bin/cmake -E cmake_progress_report /home/xxx/ParMETIS/build/Linux-x86_64/CMakeFiles 1
[  1%] Building C object libparmetis/CMakeFiles/parmetis.dir/akwayfm.c.o
cd /home/xxx/ParMETIS/build/Linux-x86_64/libparmetis && /usr/lib64/mpich-3.2/bin/mpicc   -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -march=native -fPIC -Werror -Wall -pedantic -Wno-unused-function -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -Wno-unused-label -DNDEBUG -DNDEBUG2 -DHAVE_EXECINFO_H -DHAVE_GETLINE -O3 -I/home/xxx/ParMETIS/include -I"/home/xxx/ParMETIS/~/local/include" -I/root/local/include -I/home/xxx/ParMETIS/libparmetis/.    -o CMakeFiles/parmetis.dir/akwayfm.c.o   -c /home/xxx/ParMETIS/libparmetis/akwayfm.c
In file included from /root/local/include/GKlib.h:41:0,
                 from /home/xxx/ParMETIS/libparmetis/./parmetislib.h:20,
                 from /home/xxx/ParMETIS/libparmetis/akwayfm.c:14:
/usr/include/signal.h:156:1: error: unknown type name ‘siginfo_t’
 extern void psiginfo (const siginfo_t *__pinfo, const char *__s);
 ^
make[3]: *** [libparmetis/CMakeFiles/parmetis.dir/akwayfm.c.o] Error 1
make[3]: Leaving directory `/home/xxx/ParMETIS/build/Linux-x86_64'
make[2]: *** [libparmetis/CMakeFiles/parmetis.dir/all] Error 2
make[2]: Leaving directory `/home/xxx/ParMETIS/build/Linux-x86_64'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/xxx/ParMETIS/build/Linux-x86_64'
make: *** [install] Error 2

Any ideas how to fix this?

@karypis
Copy link
Contributor

karypis commented Jan 3, 2022

This error comes from your system's include files. Did you figure it out?

@ArashRezaei
Copy link

I want to build ParMetis but I got this error:
.
.
.
.
========================ERROR=====================
/home/user1/ParMETIS/libparmetis/gkmpi.c: In function ‘libparmetis__gkMPI_Alltoallv’:
/home/user1/ParMETIS/libparmetis/gkmpi.c:194:5: error: this ‘if’ clause does not guard... [-Werror=misleading-indentation]
194 | if (sendcounts[i] >= INT_MAX || sdispls[i] >= INT_MAX ||
| ^~
/home/user1/ParMETIS/libparmetis/gkmpi.c:197:7: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
197 | break;
| ^~~~~
/home/user1/ParMETIS/libparmetis/gkmpi.c: In function ‘libparmetis__gkMPI_Allgatherv’:
/home/user1/ParMETIS/libparmetis/gkmpi.c:253:5: error: this ‘if’ clause does not guard... [-Werror=misleading-indentation]
253 | if (sendcount >= INT_MAX || recvcounts[i] >= INT_MAX || rdispls[i] >= INT_MAX)
| ^~
/home/user1/ParMETIS/libparmetis/gkmpi.c:255:7: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
255 | break;
| ^~~~~
/home/user1/ParMETIS/libparmetis/gkmpi.c: In function ‘libparmetis__gkMPI_Scatterv’:
/home/user1/ParMETIS/libparmetis/gkmpi.c:305:20: error: comparison between pointer and integer [-Werror]
305 | if (sendcounts >= INT_MAX || recvcount >= INT_MAX || sdispls[i] >= INT_MAX)
| ^~
/home/user1/ParMETIS/libparmetis/gkmpi.c:305:5: error: this ‘if’ clause does not guard... [-Werror=misleading-indentation]
305 | if (sendcounts >= INT_MAX || recvcount >= INT_MAX || sdispls[i] >= INT_MAX)
| ^~
/home/user1/ParMETIS/libparmetis/gkmpi.c:307:7: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
307 | break;
| ^~~~~
/home/user1/ParMETIS/libparmetis/gkmpi.c: In function ‘libparmetis__gkMPI_Gatherv’:
/home/user1/ParMETIS/libparmetis/gkmpi.c:357:5: error: this ‘if’ clause does not guard... [-Werror=misleading-indentation]
357 | if (sendcount >= INT_MAX || recvcounts[i] >= INT_MAX || rdispls[i] >= INT_MAX)
| ^~
/home/user1/ParMETIS/libparmetis/gkmpi.c:359:7: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
359 | break;
| ^~~~~
cc1: all warnings being treated as errors
make[3]: *** [libparmetis/CMakeFiles/parmetis.dir/build.make:209: libparmetis/CMakeFiles/parmetis.dir/gkmpi.c.o] Error 1
make[3]: Leaving directory '/home/user1/ParMETIS/build/Linux-x86_64'
make[2]: *** [CMakeFiles/Makefile2:147: libparmetis/CMakeFiles/parmetis.dir/all] Error 2
make[2]: Leaving directory '/home/user1/ParMETIS/build/Linux-x86_64'
make[1]: *** [Makefile:133: all] Error 2
make[1]: Leaving directory '/home/user1/ParMETIS/build/Linux-x86_64'
make: *** [Makefile:62: install] Error 2

@hadisinaee
Copy link

It should be fixed if you open the gkmpi.c file with vim and type gg=G in the normal mode. Also, you can use any IDE that automatically reformats the code on save.

@rushikesh-7
Copy link

rushikesh-7 commented Aug 22, 2022

Version:

  • CentOS Linux release 7.4.1708 (Core)
  • gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-39)
$ git clone --branch dgl https://github.com/KarypisLab/ParMETIS.git
$ cd ParMETIS
$ make config cc=mpicc prefix=~/local
rm -rf build/Linux-x86_64
mkdir -p build/Linux-x86_64
cd build/Linux-x86_64 && cmake /home/xxx/ParMETIS -DCMAKE_VERBOSE_MAKEFILE=1 -DGKLIB_PATH=/home/xxx/ParMETIS/~/local  -DMETIS_PATH=/home/xxx/ParMETIS/~/local -DCMAKE_INSTALL_PREFIX=/root/local -DCMAKE_C_COMPILER=mpicc
-- The C compiler identification is GNU 4.8.5
-- Check for working C compiler: /usr/lib64/mpich-3.2/bin/mpicc
-- Check for working C compiler: /usr/lib64/mpich-3.2/bin/mpicc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Looking for execinfo.h
-- Looking for execinfo.h - found
-- Looking for getline
-- Looking for getline - found
-- Configuring done
-- Generating done
-- Build files have been written to: /home/xxx/ParMETIS/build/Linux-x86_64

$ make install

And I get:

make[1]: Entering directory `/home/xxx/ParMETIS/build/Linux-x86_64'
/usr/bin/cmake -H/home/xxx/ParMETIS -B/home/xxx/ParMETIS/build/Linux-x86_64 --check-build-system CMakeFiles/Makefile.cmake 0
/usr/bin/cmake -E cmake_progress_start /home/xxx/ParMETIS/build/Linux-x86_64/CMakeFiles /home/xxx/ParMETIS/build/Linux-x86_64/CMakeFiles/progress.marks
make -f CMakeFiles/Makefile2 all
make[2]: Entering directory `/home/xxx/ParMETIS/build/Linux-x86_64'
make -f libparmetis/CMakeFiles/parmetis.dir/build.make libparmetis/CMakeFiles/parmetis.dir/depend
make[3]: Entering directory `/home/xxx/ParMETIS/build/Linux-x86_64'
cd /home/xxx/ParMETIS/build/Linux-x86_64 && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/xxx/ParMETIS /home/xxx/ParMETIS/libparmetis /home/xxx/ParMETIS/build/Linux-x86_64 /home/xxx/ParMETIS/build/Linux-x86_64/libparmetis /home/xxx/ParMETIS/build/Linux-x86_64/libparmetis/CMakeFiles/parmetis.dir/DependInfo.cmake --color=
Scanning dependencies of target parmetis
make[3]: Leaving directory `/home/xxx/ParMETIS/build/Linux-x86_64'
make -f libparmetis/CMakeFiles/parmetis.dir/build.make libparmetis/CMakeFiles/parmetis.dir/build
make[3]: Entering directory `/home/xxx/ParMETIS/build/Linux-x86_64'
/usr/bin/cmake -E cmake_progress_report /home/xxx/ParMETIS/build/Linux-x86_64/CMakeFiles 1
[  1%] Building C object libparmetis/CMakeFiles/parmetis.dir/akwayfm.c.o
cd /home/xxx/ParMETIS/build/Linux-x86_64/libparmetis && /usr/lib64/mpich-3.2/bin/mpicc   -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -march=native -fPIC -Werror -Wall -pedantic -Wno-unused-function -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -Wno-unused-label -DNDEBUG -DNDEBUG2 -DHAVE_EXECINFO_H -DHAVE_GETLINE -O3 -I/home/xxx/ParMETIS/include -I"/home/xxx/ParMETIS/~/local/include" -I/root/local/include -I/home/xxx/ParMETIS/libparmetis/.    -o CMakeFiles/parmetis.dir/akwayfm.c.o   -c /home/xxx/ParMETIS/libparmetis/akwayfm.c
In file included from /root/local/include/GKlib.h:41:0,
                 from /home/xxx/ParMETIS/libparmetis/./parmetislib.h:20,
                 from /home/xxx/ParMETIS/libparmetis/akwayfm.c:14:
/usr/include/signal.h:156:1: error: unknown type name ‘siginfo_t’
 extern void psiginfo (const siginfo_t *__pinfo, const char *__s);
 ^
make[3]: *** [libparmetis/CMakeFiles/parmetis.dir/akwayfm.c.o] Error 1
make[3]: Leaving directory `/home/xxx/ParMETIS/build/Linux-x86_64'
make[2]: *** [libparmetis/CMakeFiles/parmetis.dir/all] Error 2
make[2]: Leaving directory `/home/xxx/ParMETIS/build/Linux-x86_64'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/xxx/ParMETIS/build/Linux-x86_64'
make: *** [install] Error 2

Any ideas how to fix this?

Did you get the solution for this? I am also getting the same error

@olerichter
Copy link

olerichter commented Oct 16, 2022

if you build with
cmake [...] -D CMAKE_C_FLAGS="-D_POSIX_C_SOURCE=199309L" [...]
or
make config [...] CONFIG_FLAGS="-D CMAKE_C_FLAGS=-D_POSIX_C_SOURCE=199309L"

you should be able to build without problem,

Its a POSIX version problem at least on centos7

@phlagada
Copy link

phlagada commented Jun 9, 2023

Hi,
I am trying to build ParMETIS on Ubuntu 22.04.2 LTS but get compilation errors: three METIS options are found undeclared in initpart.c:
METIS_OPTION_NIPARTS
METIS_OPTION_DROPEDGES
METIS_OPTION_ONDISK
See listing below.
I have installed GKlib and metis-5.1.0.
I am wondering why mpicc is flagged as "skipped" during config.

$ mpicc -showme
gcc -I/usr/lib/x86_64-linux-gnu/openmpi/include -I/usr/lib/x86_64-linux-gnu/openmpi/include/openmpi -L/usr/lib/x86_64-linux-gnu/openmpi/lib -lmpi

I am still much of a beginner and would be very grateful if you could help me fix this.


$ make config cc=mpicc prefix=~/local
rm -rf build/Linux-x86_64
mkdir -p build/Linux-x86_64
cd build/Linux-x86_64 && cmake /home/XXX/ParMETIS -DCMAKE_VERBOSE_MAKEFILE=1 -DGKLIB_PATH=/home/XXX/ParMETIS//local -DMETIS_PATH=/home/XXX/ParMETIS//local -DCMAKE_INSTALL_PREFIX=/home/XXX/local -DCMAKE_C_COMPILER=mpicc
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
Compatibility with CMake < 2.8.12 will be removed from a future version of
CMake.

Update the VERSION argument value or use a ... suffix to tell
CMake that the project does not need compatibility with older versions.

-- The C compiler identification is GNU 11.3.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/mpicc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Looking for execinfo.h
-- Looking for execinfo.h - found
-- Looking for getline
-- Looking for getline - found
-- Configuring done
-- Generating done
-- Build files have been written to: /home/XXX/ParMETIS/build/Linux-x86_64

XXX@XXX:~/ParMETIS$ make install
make[1]: Entering directory '/home/XXX/ParMETIS/build/Linux-x86_64'
/usr/bin/cmake -S/home/XXX/ParMETIS -B/home/XXX/ParMETIS/build/Linux-x86_64 --check-build-system CMakeFiles/Makefile.cmake 0
/usr/bin/cmake -E cmake_progress_start /home/XXX/ParMETIS/build/Linux-x86_64/CMakeFiles /home/XXX/ParMETIS/build/Linux-x86_64//CMakeFiles/progress.marks
make -f CMakeFiles/Makefile2 all
make[2]: Entering directory '/home/XXX/ParMETIS/build/Linux-x86_64'
make -f libparmetis/CMakeFiles/parmetis.dir/build.make libparmetis/CMakeFiles/parmetis.dir/depend
make[3]: Entering directory '/home/XXX/ParMETIS/build/Linux-x86_64'
cd /home/XXX/ParMETIS/build/Linux-x86_64 && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/XXX/ParMETIS /home/XXX/ParMETIS/libparmetis /home/XXX/ParMETIS/build/Linux-x86_64 /home/XXX/ParMETIS/build/Linux-x86_64/libparmetis /home/XXX/ParMETIS/build/Linux-x86_64/libparmetis/CMakeFiles/parmetis.dir/DependInfo.cmake --color=
make[3]: Leaving directory '/home/XXX/ParMETIS/build/Linux-x86_64'
make -f libparmetis/CMakeFiles/parmetis.dir/build.make libparmetis/CMakeFiles/parmetis.dir/build
make[3]: Entering directory '/home/XXX/ParMETIS/build/Linux-x86_64'

[... Skipping several successful steps ...]

[ 28%] Building C object libparmetis/CMakeFiles/parmetis.dir/initpart.c.o
cd /home/XXX/ParMETIS/build/Linux-x86_64/libparmetis && /usr/bin/mpicc -I/home/XXX/ParMETIS/include -I"/home/XXX/ParMETIS/~/local/include" -I/home/XXX/local/include -I/home/XXX/ParMETIS/libparmetis/. -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -march=native -fPIC -Werror -Wall -pedantic -Wno-unused-function -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -Wno-unused-label -DNDEBUG -DNDEBUG2 -DHAVE_EXECINFO_H -DHAVE_GETLINE -O3 -MD -MT libparmetis/CMakeFiles/parmetis.dir/initpart.c.o -MF CMakeFiles/parmetis.dir/initpart.c.o.d -o CMakeFiles/parmetis.dir/initpart.c.o -c /home/XXX/ParMETIS/libparmetis/initpart.c
/home/XXX/ParMETIS/libparmetis/initpart.c: In function ‘libparmetis__InitPartition’:
/home/XXX/ParMETIS/libparmetis/initpart.c:77:14: error: ‘METIS_OPTION_NIPARTS’ undeclared (first use in this function); did you mean ‘METIS_OPTION_TPWGTS’?
77 | moptions[METIS_OPTION_NIPARTS] = 1;
| ^~~~~~~~~~~~~~~~~~~~
| METIS_OPTION_TPWGTS
/home/XXX/ParMETIS/libparmetis/initpart.c:77:14: note: each undeclared identifier is reported only once for each function it appears in
/home/XXX/ParMETIS/libparmetis/initpart.c:78:14: error: ‘METIS_OPTION_DROPEDGES’ undeclared (first use in this function); did you mean ‘METIS_OPTION_TPWGTS’?
78 | moptions[METIS_OPTION_DROPEDGES] = 1;
| ^~~~~~~~~~~~~~~~~~~~~~
| METIS_OPTION_TPWGTS
/home/XXX/ParMETIS/libparmetis/initpart.c:79:14: error: ‘METIS_OPTION_ONDISK’ undeclared (first use in this function); did you mean ‘METIS_OPTION_CONTIG’?
79 | moptions[METIS_OPTION_ONDISK] = 1;
| ^~~~~~~~~~~~~~~~~~~
| METIS_OPTION_CONTIG
make[3]: *** [libparmetis/CMakeFiles/parmetis.dir/build.make:289: libparmetis/CMakeFiles/parmetis.dir/initpart.c.o] Error 1
make[3]: Leaving directory '/home/XXX/ParMETIS/build/Linux-x86_64'
make[2]: *** [CMakeFiles/Makefile2:145: libparmetis/CMakeFiles/parmetis.dir/all] Error 2
make[2]: Leaving directory '/home/XXX/ParMETIS/build/Linux-x86_64'
make[1]: *** [Makefile:139: all] Error 2
make[1]: Leaving directory '/home/XXX/ParMETIS/build/Linux-x86_64'
make: *** [Makefile:62: install] Error 2

@Barenya255
Copy link

Barenya255 commented Aug 27, 2023

Hi, @phlagada , was facing the same error.
A probable cause for this is that you've used sudo apt install to install METIS. This, I think installs an older version of METIS instead which does not contain

typedef enum {
  METIS_OPTION_PTYPE,
  METIS_OPTION_OBJTYPE,
  METIS_OPTION_CTYPE,
  METIS_OPTION_IPTYPE,
  METIS_OPTION_RTYPE,
  METIS_OPTION_DBGLVL,
  METIS_OPTION_NIPARTS,
  METIS_OPTION_NITER,
  METIS_OPTION_NCUTS,
  METIS_OPTION_SEED,
  METIS_OPTION_ONDISK,
  METIS_OPTION_MINCONN,
  METIS_OPTION_CONTIG,
  METIS_OPTION_COMPRESS,
  METIS_OPTION_CCORDER,
  METIS_OPTION_PFACTOR,
  METIS_OPTION_NSEPS,
  METIS_OPTION_UFACTOR,
  METIS_OPTION_NUMBERING,
  METIS_OPTION_DROPEDGES,
  METIS_OPTION_NO2HOP,
  METIS_OPTION_TWOHOP,
  METIS_OPTION_FAST,

  /* Used for command-line parameter purposes */
  METIS_OPTION_HELP,
  METIS_OPTION_TPWGTS,
  METIS_OPTION_NCOMMON,
  METIS_OPTION_NOOUTPUT,
  METIS_OPTION_BALANCE,
  METIS_OPTION_GTYPE,
  METIS_OPTION_UBVEC
} moptions_et;

So, reinstall metis by cloning the git repo and following the instructions on the readme.
For me, once I did that, it worked fine.

@phlagada
Copy link

Hi @Barenya255,
I had left this issue on the back burner...
Thanks a lot for your reply, I have followed your recommendation and this has worked fine for me too.

Perhaps one thing worth mentioning: installation is successful with the 'gdb' flag set to 1. But, trying with the 'debug' flag set to 1 [I don't need it, actually...], I got two warnings (which were treated as errors):
/home/XXX/metis/libmetis/kwayfm.c: In function ‘libmetis__Greedy_McKWayCutOptimize’:
/home/XXX/metis/libmetis/kwayfm.c:954:46: error: ‘to’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
954 | +1, pwgts+toncon, pijbm+toncon))
| ~~^~~~~
/home/XXX/metis/libmetis/kwayfm.c: In function ‘libmetis__Greedy_McKWayVolOptimize’:
/home/XXX/metis/libmetis/kwayfm.c:1305:45: error: ‘to’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
1305 | +1, pwgts+toncon, pijbm+toncon))
| ~~^~~~~

@hiGiraffe
Copy link

if you build with cmake [...] -D CMAKE_C_FLAGS="-D_POSIX_C_SOURCE=199309L" [...] or make config [...] CONFIG_FLAGS="-D CMAKE_C_FLAGS=-D_POSIX_C_SOURCE=199309L"

you should be able to build without problem,

Its a POSIX version problem at least on centos7

Hi, using centos7, I met the same error. And I tried your method. However, I get.

rm -rf build/Linux-x86_64
mkdir -p build/Linux-x86_64
cd build/Linux-x86_64 && cmake /data/cjl/ASC/OpenCAEPoro_ASC2024-main/parmetis-4.0.3 -D CMAKE_C_FLAGS=-D_POSIX_C_SOURCE=199309L
-- The C compiler identification is GNU 4.8.5
-- The CXX compiler identification is GNU 4.8.5
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc - works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ - works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at CMakeLists.txt:26 (include):
  include could not find load file:

    METIS/GKlib/GKlibSystem.cmake


CMake Error at CMakeLists.txt:36 (add_subdirectory):
  add_subdirectory given source "METIS/libmetis" which is not an existing
  directory.


-- Configuring incomplete, errors occurred!
See also "/data/cjl/ASC/OpenCAEPoro_ASC2024-main/parmetis-4.0.3/build/Linux-x86_64/CMakeFiles/CMakeOutput.log".
make: *** [config] Error 1

Then I tried to set

mv metis METIS

and tried agin, I get

mkdir -p build/Linux-x86_64
cd build/Linux-x86_64 && cmake /data/cjl/ASC/OpenCAEPoro_ASC2024-main/parmetis-4.0.3 -D CMAKE_C_FLAGS=-D_POSIX_C_SOURCE=199309L
-- The C compiler identification is GNU 4.8.5
-- The CXX compiler identification is GNU 4.8.5
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc - works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ - works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for execinfo.h
-- Looking for execinfo.h - found
-- Looking for getline
-- Looking for getline - found
CMake Error at /data/cjl/ASC/OpenCAEPoro_ASC2024-main/parmetis-4.0.3/build/Linux-x86_64/CMakeFiles/CMakeTmp/CMakeLists.txt:13 (add_executable):
  Cannot find source file:

    METIS/GKlib/conf/check_thread_storage.c

  Tried extensions .c .C .c++ .cc .cpp .cxx .cu .m .M .mm .h .hh .h++ .hm
  .hpp .hxx .in .txx


CMake Error at /data/cjl/ASC/OpenCAEPoro_ASC2024-main/parmetis-4.0.3/build/Linux-x86_64/CMakeFiles/CMakeTmp/CMakeLists.txt:13 (add_executable):
  No SOURCES given to target: cmTC_fce98


CMake Error at METIS/GKlib/GKlibSystem.cmake:110 (try_compile):
  Failed to generate test project build system.
Call Stack (most recent call first):
  CMakeLists.txt:26 (include)


-- Configuring incomplete, errors occurred!
See also "/data/cjl/ASC/OpenCAEPoro_ASC2024-main/parmetis-4.0.3/build/Linux-x86_64/CMakeFiles/CMakeOutput.log".
make: *** [config] Error 1

Did you get the solution for this?

@galeselee
Copy link

galeselee commented Dec 28, 2023

@hiGiraffe
Hope this will help you

CMakeLists.txt

Line4, Line5
set(GKLIB_PATH METIS/GKlib  -> set(GKLIB_PATH metis/GKlib 
set(METIS_PATH METIS  -> set(METIS_PATH metis

build-parmetis.sh: the absoluted path need to be replaced with yours

#!/bin/bash
make config prefix= CONFIG_FLAGS="-D CMAKE_C_FLAGS=-D_POSIX_C_SOURCE=199309L -DCMAKE_C_COMPILER=mpicc -DCMAKE_INSTALL_PREFIX="
make -j 16 
make install

metis/GKlib/GKlibSystem.cmake

L113
use absoluted path to replace ${GKLIB_PATH}/conf/check_thread_storage.c

@TakisCFD
Copy link

I am getting the following error on apple silicon

&& /opt/homebrew/bin/mpicc -Dparmetis_EXPORTS -I/Users/takis/Downloads/ParMETIS-main/include -I/usr/local/include -I/opt/homebrew/Cellar/metis/5.1.0/include -I/Users/takis/Downloads/ParMETIS-main/libparmetis/. -DLINUX -D_FILE_OFFSET_BITS=64 -framework Accelerate -DNDEBUG -DNDEBUG2 -DHAVE_EXECINFO_H -DHAVE_GETLINE -O3 -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk -mmacosx-version-min=14.1 -fPIC -MD -MT libparmetis/CMakeFiles/parmetis.dir/initpart.c.o -MF CMakeFiles/parmetis.dir/initpart.c.o.d -o CMakeFiles/parmetis.dir/initpart.c.o -c /Users/takis/Downloads/ParMETIS-main/libparmetis/initpart.c
clang: warning: -framework Accelerate: 'linker' input unused [-Wunused-command-line-argument]
/Users/takis/Downloads/ParMETIS-main/libparmetis/initpart.c:77:14: error: use of undeclared identifier 'METIS_OPTION_NIPARTS'
moptions[METIS_OPTION_NIPARTS] = 1;
^
/Users/takis/Downloads/ParMETIS-main/libparmetis/initpart.c:78:14: error: use of undeclared identifier 'METIS_OPTION_DROPEDGES'
moptions[METIS_OPTION_DROPEDGES] = 1;
^
/Users/takis/Downloads/ParMETIS-main/libparmetis/initpart.c:79:14: error: use of undeclared identifier 'METIS_OPTION_ONDISK'; did you mean 'METIS_OPTION_CONTIG'?
moptions[METIS_OPTION_ONDISK] = 1;
^~~~~~~~~~~~~~~~~~~
METIS_OPTION_CONTIG
/opt/homebrew/Cellar/metis/5.1.0/include/metis.h:270:3: note: 'METIS_OPTION_CONTIG' declared here
METIS_OPTION_CONTIG,
^
3 errors generated.
make[3]: *** [libparmetis/CMakeFiles/parmetis.dir/initpart.c.o] Error 1
make[2]: *** [libparmetis/CMakeFiles/parmetis.dir/all] Error 2
make[1]: *** [all] Error 2
make: *** [install] Error 2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests