Skip to content
This repository has been archived by the owner on Jan 26, 2021. It is now read-only.

compile faild with Alpine linux (GCC 9) #136

Open
ic-starter opened this issue Nov 25, 2020 · 3 comments
Open

compile faild with Alpine linux (GCC 9) #136

ic-starter opened this issue Nov 25, 2020 · 3 comments
Assignees

Comments

@ic-starter
Copy link

Scanning dependencies of target opendb
[ 48%] Building CXX object src/db/CMakeFiles/opendb.dir/dbBTerm.cpp.o
In file included from /usr/include/limits.h:8,
from /root/temp/opendb/include/opendb/odb.h:37,
from /root/temp/opendb/include/opendb/ZException.h:35,
from /root/temp/opendb/src/db/dbAttrTable.h:35,
from /root/temp/opendb/src/db/dbCore.h:47,
from /root/temp/opendb/src/db/dbBTerm.h:37,
from /root/temp/opendb/src/db/dbBTerm.cpp:33:
/root/temp/opendb/src/db/dbAttrTable.h:51:21: error: expected unqualified-id before numeric constant
51 | static const uint PAGE_SIZE;
| ^~~~~~~~~
/root/temp/opendb/src/db/dbAttrTable.h:162:28: error: expected unqualified-id before numeric constant
162 | const uint dbAttrTable::PAGE_SIZE = 32;
| ^~~~~~~~~
/root/temp/opendb/src/db/dbAttrTable.h: In function 'odb::dbOStream& odb::operator<<(odb::dbOStream&, const odb::dbAttrTable&)':
/root/temp/opendb/src/db/dbAttrTable.h:254:39: error: expected unqualified-id before numeric constant
254 | for (j = 0; j < dbAttrTable::PAGE_SIZE; ++j)

cmake information:

[root@cec0efcfcea7 build]$ cmake .. -Wno-dev
-- The CXX compiler identification is GNU 9.3.0
-- 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
-- Found Tclsh: /usr/bin/tclsh (found version "8.6")
-- Found TCL: /usr/lib/libtcl8.6.so
-- Found TCLTK: /usr/lib/libtcl8.6.so
-- Found TK: /usr/lib/libtk8.6.so
-- Found Boost: /usr/lib/cmake/Boost-1.72.0/BoostConfig.cmake (found version "1.72.0")
-- Looking for C++ include pthread.h
-- Looking for C++ include pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- leflib_home: /root/temp/opendb/src/lef
-- Found BISON: /usr/bin/bison (found version "3.6.2")
-- Found ZLIB: /lib/libz.so (found version "1.2.11")
-- Found Boost: /usr/lib/cmake/Boost-1.72.0/BoostConfig.cmake (found version "1.72.0") found components: unit_test_framework
-- Found SWIG: /usr/bin/swig (found suitable version "4.0.1", minimum required is "3.0")
-- Found Python3: /usr/lib/libpython3.8.so (found version "3.8") found components: Development
-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)
-- Configuring done
-- Generating done
-- Build files have been written to: /root/temp/opendb/build

@ic-starter ic-starter changed the title compile faild with Alpinx linux (GCC 9) compile faild with Alpine linux (GCC 9) Nov 25, 2020
@ic-starter
Copy link
Author

problem maybe caused by PAGE_SIZE definition both inside of :
src/db/dbAttrTable.h
src/db/dbPageVector.h
rename each PAGE_SIZE by add a prefix, e.,g C_PAGE_SIZE and V_PAGE_SIZE
the problem is gone in my case.

@osamahammad21
Copy link
Member

@ic-starter Hi there and sorry for the late reply. The problem is that Alpine linux is based on musl which already defines PAGE_SIZE as a macro. This means that you cannot use PAGE_SIZE as a variable name, because the pre-processor replaces any "PAGE_SIZE" with its predefined value (it does not understand that it is not the same scope).
For now, using the docker should always work fine.
@maliberty if we want to support misc distribution, we need to rename PAGE_SIZE.

@maliberty
Copy link
Member

@osamahammad21 yuck. Let's rename to page_size & page_shift.

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

No branches or pull requests

3 participants