Code::Blocks
User forums => Help => Topic started by: alexchen on April 30, 2019, 02:43:31 am
-
I try to build Code::Blocks from source in CentOS 7.6 but it fails.
1. I get the source code from trunk:
svn export http://svn.code.sf.net/p/codeblocks/code/trunk
2. Install wxGTK development pre-requisite
yum install -y wxGTK-devel
3. Run the commands as listed in http://wiki.codeblocks.org/index.php/Installing_Code::Blocks_from_source_on_RPM_based_distributions#Build_the_RPM_package
cd trunk
./bootstrap
./configure
make dist
4. I get the following errors in 'make dist'
make[4]: Leaving directory `/home/fmserver/Downloads/CodeBlocks/trunk/src/plugins/xpmanifest'
(cd contrib && make top_distdir=../../../codeblocks-17.12svn0 distdir=../../../codeblocks-17.12svn0/src/plugins/contrib \
am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)
make[4]: Entering directory `/home/fmserver/Downloads/CodeBlocks/trunk/src/plugins/contrib'
make[4]: *** No rule to make target `FortranProject/*.h', needed by `distdir'. Stop.
make[4]: Leaving directory `/home/fmserver/Downloads/CodeBlocks/trunk/src/plugins/contrib'
make[3]: *** [distdir] Error 1
make[3]: Leaving directory `/home/fmserver/Downloads/CodeBlocks/trunk/src/plugins'
make[2]: *** [distdir] Error 1
make[2]: Leaving directory `/home/fmserver/Downloads/CodeBlocks/trunk/src'
make[1]: *** [distdir] Error 1
make[1]: Leaving directory `/home/fmserver/Downloads/CodeBlocks/trunk'
make: *** [dist] Error 2
-
I rebuild the source with the following commands and get a different error.
* ./configure --enable-fortran
* make all
* make list
....
make[7]: Entering directory '/home/fmserver/Downloads/CodeBlocks/trunk/src/plugins/contrib'
make distdir-am
make[8]: Entering directory '/home/fmserver/Downloads/CodeBlocks/trunk/src/plugins/contrib'
make[8]: *** No rule to make target 'FortranProject/images/*.png', needed by 'distdir-am'. Stop.
make[8]: Leaving directory '/home/fmserver/Downloads/CodeBlocks/trunk/src/plugins/contrib'
make[7]: *** [Makefile:709: distdir] Error 2
make[7]: Leaving directory '/home/fmserver/Downloads/CodeBlocks/trunk/src/plugins/contrib'
make[6]: *** [Makefile:626: distdir-am] Error 1
make[6]: Leaving directory '/home/fmserver/Downloads/CodeBlocks/trunk/src/plugins'
make[5]: *** [Makefile:622: distdir] Error 2
make[5]: Leaving directory '/home/fmserver/Downloads/CodeBlocks/trunk/src/plugins'
make[4]: *** [Makefile:636: distdir-am] Error 1
make[4]: Leaving directory '/home/fmserver/Downloads/CodeBlocks/trunk/src'
make[3]: *** [Makefile:632: distdir] Error 2
make[3]: Leaving directory '/home/fmserver/Downloads/CodeBlocks/trunk/src'
make[2]: *** [Makefile:776: distdir-am] Error 1
make[2]: Leaving directory '/home/fmserver/Downloads/CodeBlocks/trunk'
make[1]: *** [Makefile:770: distdir] Error 2
make[1]: Leaving directory '/home/fmserver/Downloads/CodeBlocks/trunk'
make: *** [Makefile:871: dist] Error 2
-
I am able to finish the build with a different configure flag
* ./configure --disable-fortran
* make all
* make list
How do I build an installable RPM after this?
Where do I run the command 'rpmbuild --rebuild codeblocks*.src.rpm' from? (This is part of the instructions to build the RPM.)
-
Why do you export the svn repository? This removes the svn metadata which will lead to revision 0 in the about box which is not really helpful. Plus without extra parameters it doesnt include the externals, thats why FortranProject is missing for you.
-
I use 'svn checkout' to get the source code but 'make dist' still gives me the same error.
- svn checkout http://svn.code.sf.net/p/codeblocks/code/trunk
- cd trunk
- ./bootstrap
- ./configure
- make all <----- This works.
- sudo make install <--------- This works, too.
- make list <----- This fails. Is it OK to ignore the errors?
make[4]: Entering directory `/home/fmserver/Downloads/CodeBlocks.http/trunk/src/plugins/contrib'
make[4]: *** No rule to make target `FortranProject/images/*.png', needed by `distdir'. Stop.
make[4]: Leaving directory `/home/fmserver/Downloads/CodeBlocks.http/trunk/src/plugins/contrib'
make[3]: *** [distdir] Error 1
make[3]: Leaving directory `/home/fmserver/Downloads/CodeBlocks.http/trunk/src/plugins'
make[2]: *** [distdir] Error 1
make[2]: Leaving directory `/home/fmserver/Downloads/CodeBlocks.http/trunk/src'
make[1]: *** [distdir] Error 1
make[1]: Leaving directory `/home/fmserver/Downloads/CodeBlocks.http/trunk'
make: *** [dist] Error 2
Question: how do I build the RPM?
According to the instruction, I need to run 'rpmbuild --rebuild codeblocks*.src.rpm'. But where to run it from?
-
./bootstrap
./configure
make dist
rpmbuild -ba codeblocks*.tar.*
If you like you can use a separate build folder.
-
Because 'make dist' cannot finish the build, I get the following errors:
$ pwd
/home/fmserver/Downloads/CodeBlocks.http/trunk
$ sudo make dist
[sudo] password for fmserver:
make dist-bzip2 am__post_remove_distdir='@:'
make[1]: Entering directory `/home/fmserver/Downloads/CodeBlocks.http/trunk'
if test -d "codeblocks-17.12svn11664"; then find "codeblocks-17.12svn11664" -type d ! -perm -200 -exec chmod u+w {} ';' && rm -rf "codeblocks-17.12svn11664" || { sleep 5 && rm -rf "codeblocks-17.12svn11664"; }; else :; fi
test -d "codeblocks-17.12svn11664" || mkdir "codeblocks-17.12svn11664"
(cd src && make top_distdir=../codeblocks-17.12svn11664 distdir=../codeblocks-17.12svn11664/src \
....
....
make[4]: Entering directory `/home/fmserver/Downloads/CodeBlocks.http/trunk/src/plugins/contrib'
make[4]: *** No rule to make target `FortranProject/images/*.png', needed by `distdir'. Stop. <----- This is killing the build.
make[4]: Leaving directory `/home/fmserver/Downloads/CodeBlocks.http/trunk/src/plugins/contrib'
make[3]: *** [distdir] Error 1
make[3]: Leaving directory `/home/fmserver/Downloads/CodeBlocks.http/trunk/src/plugins'
make[2]: *** [distdir] Error 1
make[2]: Leaving directory `/home/fmserver/Downloads/CodeBlocks.http/trunk/src'
make[1]: *** [distdir] Error 1
make[1]: Leaving directory `/home/fmserver/Downloads/CodeBlocks.http/trunk'
make: *** [dist] Error 2
$ rpmbuild -ba codeblocks*.tar.*
error: failed to stat /home/fmserver/Downloads/CodeBlocks.http/trunk/codeblocks*.tar.*: No such file or directory
-
Pass --disable-fortran or make sure you download the external fortranproject...
-
I am running CentOS 7.6 and I use the command "svn checkout http://svn.code.sf.net/p/codeblocks/code/trunk" to get the source. The output shows 'Fortran' plugin is downloaded:
A trunk/src
A trunk/src/sdk
A trunk/src/sdk/resources
A trunk/src/sdk/resources/lexers
A trunk/src/sdk/editormanager.cpp
A trunk/src/sdk/scriptingmanager.cpp
....
....
A trunk/bundle.sh.in
A trunk/README.debian
A trunk/COMPILERS
A trunk/NEWS
U trunk
Fetching external item into 'trunk/src/plugins/contrib/FortranProject':
A trunk/src/plugins/contrib/FortranProject/resources
A trunk/src/plugins/contrib/FortranProject/images
A trunk/src/plugins/contrib/FortranProject/images/22x22
A trunk/src/plugins/contrib/FortranProject/images/32x32
A trunk/src/plugins/contrib/FortranProject/images/fortranproject
A trunk/src/plugins/contrib/FortranProject/images/fortranproject/16x16
A trunk/src/plugins/contrib/FortranProject/images/fortranproject/16x16/fprojectjumpback.png
A trunk/src/plugins/contrib/FortranProject/images/fortranproject/16x16/interface_function_gen.png
A trunk/src/plugins/contrib/FortranProject/images/fortranproject/16x16/fprojectjumphome.png
A trunk/src/plugins/contrib/FortranProject/fortranproject.cpp
A trunk/src/plugins/contrib/FortranProject/resources/fortranprojecttoolbar.xrc
A trunk/src/plugins/contrib/FortranProject/resources/workspacebrowserf.xrc
A trunk/src/plugins/contrib/FortranProject/images/fortranproject/16x16/interface_private.png
A trunk/src/plugins/contrib/FortranProject/images/fortranproject/16x16/interface_subroutine_gen_private.png
I can complete 'make dist' if I use './configure --disable-fortran'. But it still fails in 'rpmbuild'.
$ make dist
make dist-bzip2 am__post_remove_distdir='@:'
make[1]: Entering directory `/home/fmserver/Downloads/CodeBlocks.http/trunk'
if test -d "codeblocks-17.12svn11664"; then find "codeblocks-17.12svn11664" -type d ! -perm -200 -exec chmod u+w {} ';' && rm -rf "codeblocks-17.12svn11664" || { sleep 5 && rm -rf "codeblocks-17.12svn11664"; }; else :; fi
test -d "codeblocks-17.12svn11664" || mkdir "codeblocks-17.12svn11664"
(cd src && make top_distdir=../codeblocks-17.12svn11664 distdir=../codeblocks-17.12svn11664/src \
.....
....
|| find "codeblocks-17.12svn11664" -type d ! -perm -755 \
-exec chmod u+rwx,go+rx {} \; -o \
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
! -type d ! -perm -444 -exec /bin/sh /home/fmserver/Downloads/CodeBlocks.http/trunk/install-sh -c -m a+r {} {} \; \
|| chmod -R a+r "codeblocks-17.12svn11664"
tardir=codeblocks-17.12svn11664 && /bin/sh /home/fmserver/Downloads/CodeBlocks.http/trunk/missing tar chf - "$tardir" | BZIP2=${BZIP2--9} bzip2 -c >codeblocks-17.12svn11664.tar.bz2
make[1]: Leaving directory `/home/fmserver/Downloads/CodeBlocks.http/trunk'
if test -d "codeblocks-17.12svn11664"; then find "codeblocks-17.12svn11664" -type d ! -perm -200 -exec chmod u+w {} ';' && rm -rf "codeblocks-17.12svn11664" || { sleep 5 && rm -rf "codeblocks-17.12svn11664"; }; else :; fi
$ rpmbuild -ba codeblocks*.tar.*
error: File /home/fmserver/Downloads/CodeBlocks.http/trunk/codeblocks-17.12svn11664.tar.bz2 does not appear to be a specfile.
I was able to build revision 11558 with 'make' and the RPM.
(I forgot the command to build RPM, but now I will keep this in mind.)
Can you build the RPM from the instructions in "http://wiki.codeblocks.org/index.php/Installing_Code::Blocks_from_source_on_RPM_based_distributions#Build_the_RPM_package"?
-
Sorry rpmbuild -ta is the correct command...
-
Thanks. The build is now complete. This is what I learn from the exercise:
- Run './configure --disable-fortran' after './bootstrap' in the first pass, otherwise it will fail in 'make dist'.
- Only need to run 'make dist' to create the *tar.bz2 file. There is no need to run 'make', 'make all', etc.
- Resulting RPM files are located in $HOME/rpmbuild/RPMS/x86_64
Thanks for all the help. I hope someone can figure out why 'make dist' fails unless '--disable-fortran' is specified during configuration. (Sorry, I am just a simple user not a Code::Blocks developer.)