make errors unknown platforms
Closed this issue · 6 comments
Somehow the description is gone in this issue.
[ 20%] Building CXX object CMakeFiles/abc_py.dir/src/api/AbcInterfaceAPI.cpp.o In file included from /home/abc_py/src/abc/src/misc/vec/vec.h:29, from /home/abc_py/src/abc/src/base/abc/abc.h:34, from /home/abc_py/src/abc/src/base/main/main.h:30, from /home/abc_py/src/abc/src/base/main/mainInt.h:29, from /home/abc_py/src/interface/AbcInterface.h:12, from /home/abc_py/src/api/AbcInterfaceAPI.cpp:10: /home/abc_py/src/abc/src/misc/util/abc_global.h:162:5: error: #error unknown platform 162 | #error unknown platform | ^~~~~ /home/abc_py/src/abc/src/misc/util/abc_global.h:181:5: error: #error unknown platform 181 | #error unknown platform | ^~~~~ /home/abc_py/src/abc/src/misc/util/abc_global.h:200:5: error: #error unknown platform 200 | #error unknown platform | ^~~~~ /home/abc_py/src/abc/src/misc/util/abc_global.h:217:5: error: #error unknown platform 217 | #error unknown platform | ^~~~~ /home/abc_py/src/abc/src/misc/util/abc_global.h:234:5: error: #error unknown platform 234 | #error unknown platform | ^~~~~
This is ABC issue, and I am not sure about it. I took a brief look on ABC, abc_global.h is defining a branch of data types and there are some open issues at ABC about unknown platform on Mac OS and etc.
I don't really know about it. I would guess you need to define some macro to work around the default platform detection. Try build the ABC on your machine, and check on the macro definination.
Plus, I found the origin 'abc_py/src/interface/AbcInterface.h' with '#include <abc_src/base/main/mainInt.h>
#include <abc_src/base/abc/abc.h>', but not this dir 'abc_src'. So I copied abc source into the src dir of abc_py. Does that make sense?
It should be fine. As long as it finds the correct header files.
A high-level remark: ABC is written in C and the way I am using the lib is somewhat hacking.
It looks like ABC might use a small program to hack and get the data size. See: https://github.com/berkeley-abc/abc/blob/66098723ebb9bede7a84ebb1d85b2d72c874bac5/Makefile#L41-L46
To be honest, I really have no idea on how ABC is organizing this. I would suggest using an ordinary Linux system. Their codes are pretty low-level, so the computer platform might affect the results.
It looks like ABC might use a small program to hack and get the data size. See: https://github.com/berkeley-abc/abc/blob/66098723ebb9bede7a84ebb1d85b2d72c874bac5/Makefile#L41-L46
To be honest, I really have no idea on how ABC is organizing this. I would suggest using an ordinary Linux system. Their codes are pretty low-level, so the computer platform might affect the results.
Thank you for your reply. So would you please update an detailed build procedure of abc_py? Thank you.
It looks like ABC might use a small program to hack and get the data size. See: https://github.com/berkeley-abc/abc/blob/66098723ebb9bede7a84ebb1d85b2d72c874bac5/Makefile#L41-L46
To be honest, I really have no idea on how ABC is organizing this. I would suggest using an ordinary Linux system. Their codes are pretty low-level, so the computer platform might affect the results.Thank you for your reply. So would you please update an detailed build procedure of abc_py? Thank you.
Sorry for the inconveience but I probably wouldn't update anything at this point.
I am not knowledgable about ABC and I cannot reproduce your problem. I would only say you might want to define "ABC_USE_STDINT_H=1" in the CMakelist.txt. See: https://stackoverflow.com/questions/6770834/how-to-add-macros-definition-in-cmake
But I cannot promise it would work. And even it would pass the compilation, hacking those low-level thing might cause unexpected behavior. I don't really know how ABC organize their codes. I would rather suggest you to use a platform that ABC supports or request their support on your platform.
It looks like ABC might use a small program to hack and get the data size. See: https://github.com/berkeley-abc/abc/blob/66098723ebb9bede7a84ebb1d85b2d72c874bac5/Makefile#L41-L46
To be honest, I really have no idea on how ABC is organizing this. I would suggest using an ordinary Linux system. Their codes are pretty low-level, so the computer platform might affect the results.Thank you for your reply. So would you please update an detailed build procedure of abc_py? Thank you.
Sorry for the inconveience but I probably wouldn't update anything at this point.
I am not knowledgable about ABC and I cannot reproduce your problem. I would only say you might want to define "ABC_USE_STDINT_H=1" in the CMakelist.txt. See: https://stackoverflow.com/questions/6770834/how-to-add-macros-definition-in-cmake
But I cannot promise it would work. And even it would pass the compilation, hacking those low-level thing might cause unexpected behavior. I don't really know how ABC organize their codes. I would rather suggest you to use a platform that ABC supports or request their support on your platform.
Well, thank you for your kindly repy. Aft exhausting trying, I found this solution workaround. Under Ubuntu 1604, to deal with the error error: #error unknown platform
, I first run the './arch_flags' program in abc, and get the following configuration flags:
-DLIN64 -DSIZEOF_VOID_P=8 -DSIZEOF_LONG=8 -DSIZEOF_INT=4
The I copy this into CMakeLists.txt in abc_py, and set like this:
set(CMAKE_CXX_FLAGS "-DLIN64 -DSIZEOF_VOID_P=8 -DSIZEOF_LONG=8 -DSIZEOF_INT=4 -std=c++14 -Wall -march=native -fopenmp -fPIC -lreadline")
Well, finally it works, I can make and install this interface.
However, I found when I import abc_py, there is new error:
python3.7/site-packages/abc_py-0.0.1-py3.7-linux-x86_64.egg/abc_py.cpython-37m-x86_64-linux-gnu.so: undefined symbol: _Z18Abc_NtkRetimeDebugP10Abc_Ntk_t_
It looks like ABC might use a small program to hack and get the data size. See: https://github.com/berkeley-abc/abc/blob/66098723ebb9bede7a84ebb1d85b2d72c874bac5/Makefile#L41-L46
To be honest, I really have no idea on how ABC is organizing this. I would suggest using an ordinary Linux system. Their codes are pretty low-level, so the computer platform might affect the results.Thank you for your reply. So would you please update an detailed build procedure of abc_py? Thank you.
Sorry for the inconveience but I probably wouldn't update anything at this point.
I am not knowledgable about ABC and I cannot reproduce your problem. I would only say you might want to define "ABC_USE_STDINT_H=1" in the CMakelist.txt. See: https://stackoverflow.com/questions/6770834/how-to-add-macros-definition-in-cmake
But I cannot promise it would work. And even it would pass the compilation, hacking those low-level thing might cause unexpected behavior. I don't really know how ABC organize their codes. I would rather suggest you to use a platform that ABC supports or request their support on your platform.Well, thank you for your kindly repy. Aft exhausting trying, I found this solution workaround. Under Ubuntu 1604, to deal with the error
error: #error unknown platform
, I first run the './arch_flags' program in abc, and get the following configuration flags:
-DLIN64 -DSIZEOF_VOID_P=8 -DSIZEOF_LONG=8 -DSIZEOF_INT=4
The I copy this into CMakeLists.txt in abc_py, and set like this:
set(CMAKE_CXX_FLAGS "-DLIN64 -DSIZEOF_VOID_P=8 -DSIZEOF_LONG=8 -DSIZEOF_INT=4 -std=c++14 -Wall -march=native -fopenmp -fPIC -lreadline")
Well, finally it works, I can make and install this interface.
However, I found when I import abc_py, there is new error:
python3.7/site-packages/abc_py-0.0.1-py3.7-linux-x86_64.egg/abc_py.cpython-37m-x86_64-linux-gnu.so: undefined symbol: _Z18Abc_NtkRetimeDebugP10Abc_Ntk_t_
After exhausting try and error, I found a key step maybe this, when I make libabc.a, I used **make ABC_USE_NO_READLINE=1 libabc.a**
. Then I modified the CMakelists.txt, and delete the flag -lreadline
. Then everything seems fine now.
Also, the last step, use pip install abc_py/
. Or in abc_py dir, use python setup.py bdist_wheel
to generate the .whl file and then install it.