User forums => Help => Topic started by: alexchen on April 30, 2019, 02:43:31 am
Title: Cannot build Code::Blocks from source
Post 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
Title: Re: Cannot build Code::Blocks from source
Post by: alexchen on April 30, 2019, 03:29:34 am
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
Title: Re: Cannot build Code::Blocks from source
Post by: alexchen on April 30, 2019, 03:37:53 am
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.)
Title: Re: Cannot build Code::Blocks from source
Post by: sodev on April 30, 2019, 04:12:45 am
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.
Title: Re: Cannot build Code::Blocks from source
Post by: alexchen on April 30, 2019, 08:29:52 pm
I use 'svn checkout' to get the source code but 'make dist' still gives me the same error.
$ 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
Title: Re: Cannot build Code::Blocks from source
Post by: oBFusCATed on April 30, 2019, 11:53:02 pm
Pass --disable-fortran or make sure you download the external fortranproject...
Title: Re: Cannot build Code::Blocks from source
Post by: alexchen on May 01, 2019, 12:11:18 am
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"?
Title: Re: Cannot build Code::Blocks from source
Post by: oBFusCATed on May 01, 2019, 01:13:33 am
Sorry rpmbuild -ta is the correct command...
Title: Re: Cannot build Code::Blocks from source
Post by: alexchen on May 01, 2019, 02:09:42 am
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.)