First, enter directory OptolithiumC
which in <OPTOLITHIUM_SRC>
cd <OPTOLITHIUM_SRC>/OptolithiumC
We need cmake
to install this open source software, so cmake
should be installed if not exist.
sudo apt install cmake
The following we continue installing by cmake
sudo cmake CMakeLists.txt
Here I encounter an error:
CMake Error at /usr/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:148 (message):
Could NOT find SWIG (missing: SWIG_EXECUTABLE SWIG_DIR)
It seems that we need library swig
, so we install this library first:
sudo apt install swig
Let’s continue. Another error occur:
Could NOT find PythonLibs (missing: PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS)
(Required is at least version “2.7”)
I solve this problem by append python directory in cmake
command(indicates the location of the system python):
sudo cmake CMakeLists.txt -DPYTHON_INCLUDE_DIR=/usr/include/python2.7 -DPYTHON_LIBRARY=/usr/lib/python2.7/config/libpython2.7.so
One more error:
CMake Error at FindNumPy.cmake:62 (message):
NumPy import failure:
Traceback (most recent call last):
File “<string>”, line 1, in <module>
ImportError: No module named numpy
This error was solved by installing numpy
:
pip install numpy
Encounter error:
CMake Error at /usr/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:148 (message):
Could NOT find FFTW (missing: FFTW_LIBRARIES FFTW_INCLUDES)
solved by install fftw
:
sudo apt install libfftw3-dev
And cmake
finish successfully.
The following we make install:
make install
encounter error:
/usr/bin/ld: libs/clipper/libpolyclipping.a(clipper.cpp.o): relocation R_X86_64_32 against `.rodata.str1.1’ can not be used when making a shared object; recompile with -fPIC
solve by addfPIC
flag in file CMakeList.txt
CMakeList.txt line 31:
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -include cmath -std=gnu++11 -Wall")
change to
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -include cmath -std=gnu++11 -Wall")
add new line:
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
make
succeed!
One more last thing: install required python library for GUI:
cd <OPTOLITHIUM_SRC>/OptolithiumGUI
sudo apt install qt-sdk
pip install scipy==0.15.1 psutil==2.2.1 pyside==1.2.1 matplotlib==1.4.0 filemagic==1.6 bson==0.3.3 sqlalchemy==0.9.4 python-gdsii==0.2.1
We type this command in directoryOptolithiumGUI
python main.py
You can see the UI window now!