Unable to build in Linux Ubuntu 14.04
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
KiCad |
Invalid
|
Undecided
|
Unassigned |
Bug Description
I'd really like to be able to build from source so I can do a `git bisect` to figure out which commit fixed this issue (https:/
Hopefully I can get some guidance that will get me to where I can build.
Here is the current error (Cannot find wxPython.h):
kicad/
-- KiCad install dir: </usr/local>
-- Check for installed GLEW -- found
-- Boost version: 1.54.0
-- Check for installed Python Interpreter -- found
-- Python module install path: lib/python2.
-- Found wxPython 3.0.1.1/gtk2 (wxWidgets 3.0.1.1)
-- Searching for wx/wxPython/
-- Searching for wx/wxPython/
CMake Error at CMakeLists.txt:796 (message):
Cannot find wxPython.h
-- Configuring incomplete, errors occurred!
See also "/home/
See also "/home/
-------
As developers, this also may be worth looking into to fix, but meanwhile I found a work-around I think: https:/
=======
-------
Here are my steps so far:
UPDATE: SEE MY FULL STEPS THAT FINALLY WORKED FARTHER DOWN BELOW.
Look for the asterisks ***** to see where they start.
-------
Gabriel Staples
22 Nov. 2018
References:
- http://
- http://
===============
To build KiCad:
Details:
cd <your kicad source mirror>
mkdir -p build/release
mkdir build/debug # Optional for debug build.
cd build/release
cmake -DCMAKE_
../../
make
sudo make install
Step I'm currently stuck on trying to work out dependencies:
cd /home/gabriels/
cmake -DCMAKE_
===============
INSTALL DEPENDENCIES:
TRY THIS FIRST!
- attempts to download all build dependencies for kicad-nightly, all at once.
sudo apt-get build-dep kicad-nightly
Source: https:/
GLEW
sudo apt install libglew-dev
Source: https:/
GLM:
sudo apt install libglm-dev
https:/
ngspice
Info provided by KiCad during the attempted build:
-------
*** NGSPICE library missing ***
Most of ngspice packages do not provide the required libngspice library.
You can either compile ngspice configured with --with-ngshared parameter
or run a script that does the job for you:
cd ./scripts
chmod +x get_libngspice_
./get_
sudo ./get_libngspic
-------
So, run:
cd /home/gabriels/
chmod +x get_libngspice_
./get_
sudo ./get_libngspic
OCE (Open Cascade Community Edition Library)
1. Download latest release here: https:/
2. Follow instructions here: https:/
1. Extract zip.
2. cd (into its extracted folder)
3. mkdir build
4. cd build
5. cmake ..
6. Run make with multithreading (1 job per core that you have). Ex: for an 8-core machine, run 8 jobs simultaneously (1 per core) with:
make -j8
7. sudo make install/strip
8. Ensure all tests pass (note: the instructions on the github site above say that the "BRepMeshTestSu
make test
9. Done!
SWIG
https:/
Install instructions: https:/
git clone https:/
cd swig
./autogen.sh
./configure
make
sudo make install
Do my ugly hack, as described by me here: https:/
WxWidgets/WxPython
[STUCK HERE]
We will need some dependencies to install wxpython though:
1. First, GTK+ >= 3.0:
sudo apt install libgtk-3-dev
Source: https:/
2. Gstreamer:
sudo apt install libgstreamer1.0-0 gstreamer1.
Source: https:/
Then:
sudo apt install libgstreamer-
Source: https:/
#. Finally: wxpython
(Note: the `-v` option below is so you can see its progress. Otherwise you'll wonder if it's doing anything at all since it takes a long time!)
sudo pip install wxpython -v <------FAILED
sudo pip install -f https:/
https:/
sudo apt install python-wxgtk3.0*
https:/
=======
*******
-------
UPDATE 20181124:2126HRS:
Here are my steps that finally worked.
-------
*******
Gabriel Staples
Started: 22 Nov. 2018
Updated: 24 Nov. 2018
References:
- http://
- http://
- This file will be appended to this "bug report": "Unable to build in Linux Ubuntu 14.04" - https:/
===============
To build KiCad:
Details:
cd <your kicad source mirror>
mkdir -p build/release
mkdir build/debug # Optional for debug build.
cd build/release
cmake -DCMAKE_
../../
make <----NOPE! Run one 'j'ob per cpu core instead! Ex: `make -j8` Ah....MUCH BETTER! Using `make` gave my 8-core machine an avg. load of *maybe* 20%. `make -j8` give it an average load of nearly 100%. This will compile 5~8 times faster now. Awesome.
sudo make install <----WATCH OUT! DON'T DO THIS, RIGHT? WON'T THIS INTERFERE WITH MY CURRENT NIGHTLY AND STABLE INSTALLS? JUST RUN THE EXECUTABLE IN THE RELEASE FOLDER DIRECTLY INSTEAD I THINK.
Step I'm currently stuck on trying to work out dependencies:
cd /home/gabriels/
cmake -DCMAKE_
UPDATE 20181124-0041HRS: USE THIS COMMAND INSTEAD TO DISABLE SCRIPTING (borrowed from the mac instructions here: http://
cmake -DCMAKE_
==========> FINAL cmake command ANSWER <===========: UPDATE 20181124-2059HRS: USE THIS cmake COMMAND INSTEAD (as copied from way down below):
A. (See "Sample output A:" of this cmake command at the end of this file, below.)
cmake -DCMAKE_
B. Then (to build with 8-threads: one per cpu core):
make -j8
===============
INSTALL DEPENDENCIES:
TRY THIS FIRST!
- attempts to download all build dependencies for kicad-nightly, all at once.
sudo apt-get build-dep kicad-nightly
Source: https:/
GLEW
sudo apt install libglew-dev
Source: https:/
GLM:
sudo apt install libglm-dev
https:/
ngspice
Info provided by KiCad during the attempted build:
-------
*** NGSPICE library missing ***
Most of ngspice packages do not provide the required libngspice library.
You can either compile ngspice configured with --with-ngshared parameter
or run a script that does the job for you:
cd ./scripts
chmod +x get_libngspice_
./get_
sudo ./get_libngspic
-------
So, run:
cd /home/gabriels/
chmod +x get_libngspice_
./get_
sudo ./get_libngspic
OCE (Open Cascade Community Edition Library)
1. Download latest release here: https:/
2. Follow instructions here: https:/
1. Extract zip.
2. cd (into its extracted folder)
3. mkdir build
4. cd build
5. cmake ..
6. Run make with multithreading (1 job per core that you have). Ex: for an 8-core machine, run 8 jobs simultaneously (1 per core) with:
make -j8
7. sudo make install/strip
8. Ensure all tests pass (note: the instructions on the github site above say that the "BRepMeshTestSu
make test
9. Done!
SWIG
UPDATE 20181124-0203HRS: SEE A WAYS DOWN BELOW. DO *NOT* INSTALL swig 4.0 or later! It won't work. Stick with 3.0+ instead, but < 4.0. I install swig 3.0.12 below and it works!
https:/
Install instructions: https:/
git clone https:/
cd swig
./autogen.sh
./configure
make
sudo make install
Do my ugly hack, as described by me here: https:/
UPDATE 20181124-0026HRS: I think simply ***restarting your computer*** after doing the swig build, rather than doing the "ugly hack" above, also fixes this issue and lets cmake continue past this point! *Perhaps* something like this (adding the "-DSWIG_
WxWidgets/WxPython
-------
ATTEMPT #1:
[STUCK HERE]
We will need some dependencies to install wxpython though:
1. First, GTK+ >= 3.0:
sudo apt install libgtk-3-dev
Source: https:/
2. Gstreamer:
sudo apt install libgstreamer1.0-0 gstreamer1.
Source: https:/
Then:
sudo apt install libgstreamer-
Source: https:/
#. Finally: wxpython
(Note: the `-v` option below is so you can see its progress. Otherwise you'll wonder if it's doing anything at all since it takes a long time!)
sudo pip install wxpython -v <------FAILED
sudo pip install -f https:/
https:/
sudo apt install python-wxgtk3.0*
https:/
-------
ATTEMPT #2:
Download "wxPython-
NEVERMIND.
SOLUTION: DISABLE SCRIPTING! SEE THE "UPDATE 20181124-0041HRS" above. Disable scripting by using this cmake command instead:
cmake -DCMAKE_
Solved! cmake completed! Now I can run `make`!
Running `make -j8`
I have this build error now: "/home/
cd /home/gabriels/
sudo make uninstall
sudo reboot <---this is required! It allows the old v2.0.11 of swig to be properly re-associated with the swig command apparently. Check with `swig -version` after reboot to ensure it works.
Ok, install swig 3.0.12 now. Let's give it a shot.
Download here: https:/
Extract it.
cd swig-rel-3.0.12
./autogen.sh
./configure
make -j8
sudo make install
sudo reboot
After reboot, check `swig -version`. I now get: "SWIG Version 3.0.12". Good!
`which swig` shows: "/usr/local/
"Could NOT find SWIG: Found unsuitable version "2.0.11", but required is at
least "3.0" (found /usr/bin/swig)".
So, foce it to find it with the -DSWIG_EXECUTABLE= define as follows:
cmake -DCMAKE_
Good, now go back to building:
make -j8
Failed. Same error.
So, delete the entire /build/release folder and start again.
Run the cmake command a few lines above. Done. Good.
Now run `make -j8` again. Let's see if it's any different this time.
(15 minute wait while it builds)
If this fails [UPDATE: IT WORKED!]: WHAT TO TRY NEXT:
1. Make this an Eclipse project, and get Eclipse to index it.
2. Search through these errors and see if you can actually fix them in the source code itself!
3. Consider searching through the wxwidgets kicad mac os github repo (and the kicad-mac-builder [https:/
The build worked! So, no need to try my 3 things above.
Per Jean-Pierre Charras in Comment #8 here (https:/
cmake -DCMAKE_
Also note that Seth Hillbrand's suggestion is spot-on: when changing the cmake command options, it's best to remove all files in the build directory and start over again from scratch. That, in addition to the downgrade from swig 4.0 to swig 3.0.12 above, was critical to getting the build to finally complete!
=======
Extra cmake notes for newcomers like me to cmake:
1. For more info on `cmake`, see the man pages with `man cmake`.
2. "kicad/
3. While running the cmake command, it generates a CMakeCache.txt file (ex: in "kicad/
//Build wxPython implementation for wx interface building in Python
// and py.shell (default ON).
KICAD_
That's how I'm also able to edit the SWIG_EXECUTABLE path via `-DSWIG_
//Path to a program.
SWIG_
(I imagine it wrote that value down when I passed it in as an input define to cmake). Regardless though, it works.
=======
Sample output A:
7510-gabriels ~/GS/dev/
-- The C compiler identification is GNU 4.8.4
-- The CXX compiler identification is GNU 4.8.4
-- 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
-- KiCad install dir: </usr/local>
-- Looking for malloc.h
-- Looking for malloc.h - found
-- Looking for iso646.h
-- Looking for iso646.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for strcasecmp
-- Looking for strcasecmp - found
-- Looking for strncasecmp
-- Looking for strncasecmp - found
-- Looking for strtok_r
-- Looking for strtok_r - found
-- Looking for malloc
-- Looking for malloc - found
-- Looking for math.h
-- Looking for math.h - found
-- Looking for C++ include cmath
-- Looking for C++ include cmath - found
-- Looking for asinh
-- Looking for asinh - found
-- Looking for acosh
-- Looking for acosh - found
-- Looking for atanh
-- Looking for atanh - found
-- Performing Test HAVE_CMATH_ISINF
-- Performing Test HAVE_CMATH_ISINF - Success
-- Looking for clock_gettime in rt
-- Looking for clock_gettime in rt - found
-- Looking for gettimeofday
-- Looking for gettimeofday - found
-- Looking for getc_unlocked
-- Looking for getc_unlocked - found
-- Performing Test COMPILER_
-- Performing Test COMPILER_
-- Performing Test COMPILER_
-- Performing Test COMPILER_
-- Performing Test COMPILER_
-- Performing Test COMPILER_
-- Found OpenGL: /usr/lib/
-- Found GLEW: /usr/include
-- Check for installed GLEW -- found
-- Found GLM: /usr/include (found suitable version "0.9.5.1", minimum required is "0.9.5.1")
-- Found CURL: /usr/lib/
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.26")
-- checking for module 'cairo'
-- found cairo, version 1.13.1
-- Found Cairo: /usr/lib/
-- checking for module 'pixman-1'
-- found pixman-1, version 0.30.2
-- Found Pixman: /usr/lib/
-- Boost version: 1.54.0
-- Found ngspice: /usr/local/
-- Found wxWidgets: -L/usr/
-- Found Doxygen: /usr/bin/doxygen (found version "1.8.6")
-- Found OpenSSL: /usr/lib/
-- S3DSG version: 2.0.0
-- Boost version: 1.54.0
-- Found the following Boost libraries:
-- unit_test_framework
-- Boost version: 1.54.0
-- Found the following Boost libraries:
-- unit_test_framework
-- Boost version: 1.54.0
-- Found the following Boost libraries:
-- unit_test_framework
-- Configuring done
-- Generating done
CMake Warning:
Manually-
SWIG_EXECUTABLE
-- Build files have been written to: /home/gabriels/
=======
END
description: | updated |
description: | updated |
description: | updated |
Additional question: when I build, will it cross-compile for all operating systems that KiCad supports, or does it just build for the system I'm on? How does your internal build system work such that it produces binaries for so many operating systems?