Author Topic: XBoard in Code::Blocks  (Read 1311 times)

Offline ordak

  • Multiple posting newcomer
  • *
  • Posts: 93
XBoard in Code::Blocks
« on: October 29, 2019, 12:35:20 pm »
Hi,

XBoard is a Linux project hosted in here. Can I import it into Code::Blocks or I have to build it's make_file out-side of C::B ?

Latest version for now is 4.9.1 .

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6678
    • My Best Post
Re: XBoard in Code::Blocks
« Reply #1 on: October 29, 2019, 07:19:34 pm »
I would do an Custom makefile project in Code::Blocks.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline ordak

  • Multiple posting newcomer
  • *
  • Posts: 93
Re: XBoard in Code::Blocks
« Reply #2 on: October 30, 2019, 07:20:40 pm »
I would do an Custom makefile project in Code::Blocks.

Tim S.

How can I do it ?

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6678
    • My Best Post
Re: XBoard in Code::Blocks
« Reply #3 on: October 30, 2019, 07:46:06 pm »
I do not see any Linux makefile; so, it is hard to help. I will see if I can write directions for doing it on Windows using the makefile.gcc file.

Since, there does not appear to be a Linux makefile; I would build the project outside Code::Blocks using the configure/make method.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline ordak

  • Multiple posting newcomer
  • *
  • Posts: 93
Re: XBoard in Code::Blocks
« Reply #4 on: October 31, 2019, 12:54:02 pm »
I do not see any Linux makefile; so, it is hard to help. I will see if I can write directions for doing it on Windows using the makefile.gcc file.

Since, there does not appear to be a Linux makefile; I would build the project outside Code::Blocks using the configure/make method.

Tim S.

I want to do this on Ubuntu 18.04 . On Windows there is a port of XBoard called WinBoard. see for instance:

http://hgm.nubati.net/
https://www.chessprogramming.org/WinBoard
https://www.gnu.org/software/xboard/

Offline Miguel Gimenez

  • Regular
  • ***
  • Posts: 383
Re: XBoard in Code::Blocks
« Reply #5 on: October 31, 2019, 01:18:57 pm »
You can use ./configure to generate the makefiles and then follow stahta01's advice in reply #1

Offline ordak

  • Multiple posting newcomer
  • *
  • Posts: 93
Re: XBoard in Code::Blocks
« Reply #6 on: November 08, 2019, 05:04:17 pm »
You can use ./configure to generate the makefiles and then follow stahta01's advice in reply #1

I used ./configure and generated a Makefile in the xboard directory. I created a project in Code::Blocks named xboard_fork . I added some sources which I suppose should be added. After that project>Properties>Project setting :

/home/mehdi/Documents/Code_Blocks_Projects/xboard_fork/Makefile
 And I enabled the below "This is a custom Makefile."

Now for Rebuild I get:

Code: [Select]

-------------- Clean: Release in xboard_fork (compiler: LLVM Clang Compiler 9 GTK Library)---------------

Executing clean command: make -f /home/mehdi/Documents/Code_Blocks_Projects/xboard_fork/Makefile cleanRelease
make: *** No rule to make target 'cleanRelease'.  Stop.
Error cleaning "xboard_fork - Release"

-------------- Build: Release in xboard_fork (compiler: LLVM Clang Compiler 9 GTK Library)---------------

Checking if target is up-to-date: make -q -f /home/mehdi/Documents/Code_Blocks_Projects/xboard_fork/Makefile Release
Running command: make -f /home/mehdi/Documents/Code_Blocks_Projects/xboard_fork/Makefile Release
make: *** No rule to make target 'Release'.  Stop.
Process terminated with status 2 (0 minute(s), 0 second(s))
0 error(s), 0 warning(s) (0 minute(s), 0 second(s))
 

What can I do now ?

Offline Miguel Gimenez

  • Regular
  • ***
  • Posts: 383
Re: XBoard in Code::Blocks
« Reply #7 on: November 08, 2019, 05:42:35 pm »
Probably the target name must be changed from "Release" to one of the Makefile targets, choose one (possibly "all") of

Code: [Select]
all all-am
am--refresh check check-am clean clean-aminfo
clean-binPROGRAMS clean-cscope clean-generic cscope
cscopelist-am ctags ctags-am dist dist-all dist-bzip2
dist-gzip dist-info dist-lzip dist-shar dist-tarZ dist-xz
dist-zip distcheck distclean distclean-compile
distclean-generic distclean-hdr distclean-tags distcleancheck
distdir distuninstallcheck dvi dvi-am html html-am info
info-am install install-ApplicationsDATA install-am
install-binPROGRAMS install-data install-data-am
install-data-hook install-dist_iconDATA
install-dist_pixmapsDATA install-dist_pngDATA
install-dist_shogiDATA install-dist_soundsDATA
install-dist_svgDATA install-dist_svgiconDATA
install-dist_themesDATA install-dist_xiangqiDATA install-dvi
install-dvi-am install-exec install-exec-am install-html
install-html-am install-info install-info-am install-man
install-man6 install-mimeDATA install-pdf install-pdf-am
install-ps install-ps-am install-strip install-sysconfDATA
installcheck installcheck-am installdirs installdirs-am
maintainer-clean maintainer-clean-aminfo
maintainer-clean-generic maintainer-clean-vti mostlyclean
mostlyclean-aminfo mostlyclean-compile mostlyclean-generic
mostlyclean-vti pdf pdf-am ps ps-am tags tags-am uninstall
uninstall-ApplicationsDATA uninstall-am uninstall-binPROGRAMS
uninstall-dist_iconDATA uninstall-dist_pixmapsDATA
uninstall-dist_pngDATA uninstall-dist_shogiDATA
uninstall-dist_soundsDATA uninstall-dist_svgDATA
uninstall-dist_svgiconDATA uninstall-dist_themesDATA
uninstall-dist_xiangqiDATA uninstall-dvi-am uninstall-hook
uninstall-html-am uninstall-info-am uninstall-man
uninstall-man6 uninstall-mimeDATA uninstall-pdf-am
uninstall-ps-am uninstall-sysconfDATA

Offline ordak

  • Multiple posting newcomer
  • *
  • Posts: 93
Re: XBoard in Code::Blocks
« Reply #8 on: November 08, 2019, 06:08:59 pm »
Probably the target name must be changed from "Release" to one of the Makefile targets, choose one (possibly "all") of

Code: [Select]
all all-am
am--refresh check check-am clean clean-aminfo
clean-binPROGRAMS clean-cscope clean-generic cscope
cscopelist-am ctags ctags-am dist dist-all dist-bzip2
dist-gzip dist-info dist-lzip dist-shar dist-tarZ dist-xz
dist-zip distcheck distclean distclean-compile
distclean-generic distclean-hdr distclean-tags distcleancheck
distdir distuninstallcheck dvi dvi-am html html-am info
info-am install install-ApplicationsDATA install-am
install-binPROGRAMS install-data install-data-am
install-data-hook install-dist_iconDATA
install-dist_pixmapsDATA install-dist_pngDATA
install-dist_shogiDATA install-dist_soundsDATA
install-dist_svgDATA install-dist_svgiconDATA
install-dist_themesDATA install-dist_xiangqiDATA install-dvi
install-dvi-am install-exec install-exec-am install-html
install-html-am install-info install-info-am install-man
install-man6 install-mimeDATA install-pdf install-pdf-am
install-ps install-ps-am install-strip install-sysconfDATA
installcheck installcheck-am installdirs installdirs-am
maintainer-clean maintainer-clean-aminfo
maintainer-clean-generic maintainer-clean-vti mostlyclean
mostlyclean-aminfo mostlyclean-compile mostlyclean-generic
mostlyclean-vti pdf pdf-am ps ps-am tags tags-am uninstall
uninstall-ApplicationsDATA uninstall-am uninstall-binPROGRAMS
uninstall-dist_iconDATA uninstall-dist_pixmapsDATA
uninstall-dist_pngDATA uninstall-dist_shogiDATA
uninstall-dist_soundsDATA uninstall-dist_svgDATA
uninstall-dist_svgiconDATA uninstall-dist_themesDATA
uninstall-dist_xiangqiDATA uninstall-dvi-am uninstall-hook
uninstall-html-am uninstall-info-am uninstall-man
uninstall-man6 uninstall-mimeDATA uninstall-pdf-am
uninstall-ps-am uninstall-sysconfDATA

I changed target name to "all" now I get :

Code: [Select]

-------------- Clean: all in xboard_fork (compiler: GNU GCC Compiler)---------------

Executing clean command: make -f /home/mehdi/Documents/Code_Blocks_Projects/xboard_fork/Makefile cleanall
make: *** No rule to make target 'cleanall'.  Stop.
Error cleaning "xboard_fork - all"

-------------- Build: all in xboard_fork (compiler: GNU GCC Compiler)---------------

Checking if target is up-to-date: make -q -f /home/mehdi/Documents/Code_Blocks_Projects/xboard_fork/Makefile all
Running command: make -f /home/mehdi/Documents/Code_Blocks_Projects/xboard_fork/Makefile all
make  all-recursive
make[1]: Entering directory '/home/mehdi/Documents/Code_Blocks_Projects/xboard_fork'
Making all in po
make[2]: Entering directory '/home/mehdi/Documents/Code_Blocks_Projects/xboard_fork/po'
make[2]: Leaving directory '/home/mehdi/Documents/Code_Blocks_Projects/xboard_fork/po'
make[2]: Entering directory '/home/mehdi/Documents/Code_Blocks_Projects/xboard_fork'
make[2]: Leaving directory '/home/mehdi/Documents/Code_Blocks_Projects/xboard_fork'
make[1]: Leaving directory '/home/mehdi/Documents/Code_Blocks_Projects/xboard_fork'
Process terminated with status 0 (0 minute(s), 0 second(s))
0 error(s), 0 warning(s) (0 minute(s), 0 second(s))
 


Offline ordak

  • Multiple posting newcomer
  • *
  • Posts: 93
Re: XBoard in Code::Blocks
« Reply #9 on: November 08, 2019, 06:13:25 pm »
By the way , I changed project's compiler to GNU GCC , and it's platform to Unix.

Offline Miguel Gimenez

  • Regular
  • ***
  • Posts: 383
Re: XBoard in Code::Blocks
« Reply #10 on: November 08, 2019, 06:22:39 pm »
The error while cleaning is due to the default configuration of the Make commands. You can change Project -> Build options -> Make commands -> Clean project/target and remove the $target part

The no compilation issue may be due to a previous successful compilation, or po having no Makefile, or some missing option when calling ./configure. You should ask to XBoard developers.
« Last Edit: November 08, 2019, 06:58:47 pm by Miguel Gimenez »

Offline ordak

  • Multiple posting newcomer
  • *
  • Posts: 93
Re: XBoard in Code::Blocks
« Reply #11 on: November 10, 2019, 11:32:01 am »
The error while cleaning is due to the default configuration of the Make commands. You can change Project -> Build options -> Make commands -> Clean project/target and remove the $target part

This worked.

Quote
The no compilation issue may be due to a previous successful compilation, or po having no Makefile, or some missing option when calling ./configure. You should ask to XBoard developers.

I asked XBoard coders , according to this post , I have to call "sudo make install" . Can I do that inside Code::Blocks or I have to do it outside Code::Blocks ?

Offline Miguel Gimenez

  • Regular
  • ***
  • Posts: 383
Re: XBoard in Code::Blocks
« Reply #12 on: November 10, 2019, 01:35:15 pm »
The "sudo make install" command must be executed (or not) once the "make all" command completes successfully.
You can call it as a post build step (in Build Options), but will need to specify the password, this should work (I can't test right now):
Code: [Select]
echo your_password | sudo -S make -f Makefile install
or execute

Code: [Select]
sudo -S make -f Makefile install
from command line while in folder /home/mehdi/Documents/Code_Blocks_Projects/xboard_fork

Offline ordak

  • Multiple posting newcomer
  • *
  • Posts: 93
Re: XBoard in Code::Blocks
« Reply #13 on: November 10, 2019, 02:33:23 pm »
The "sudo make install" command must be executed (or not) once the "make all" command completes successfully.
You can call it as a post build step (in Build Options), but will need to specify the password, this should work (I can't test right now):
Code: [Select]
echo your_password | sudo -S make -f Makefile install

[...]

I tried it but I did not get opportunity to enter password :

Code: [Select]

-------------- Build: all in xboard_fork (compiler: LLVM Clang Compiler 9 GTK Library)---------------

Checking if target is up-to-date: make -q -f /home/mehdi/Documents/Code_Blocks_Projects/xboard_fork/Makefile all
Running command: make -f /home/mehdi/Documents/Code_Blocks_Projects/xboard_fork/Makefile all
make  all-recursive
make[1]: Entering directory '/home/mehdi/Documents/Code_Blocks_Projects/xboard_fork'
Making all in po
make[2]: Entering directory '/home/mehdi/Documents/Code_Blocks_Projects/xboard_fork/po'
make[2]: Leaving directory '/home/mehdi/Documents/Code_Blocks_Projects/xboard_fork/po'
make[2]: Entering directory '/home/mehdi/Documents/Code_Blocks_Projects/xboard_fork'
make[2]: Leaving directory '/home/mehdi/Documents/Code_Blocks_Projects/xboard_fork'
make[1]: Leaving directory '/home/mehdi/Documents/Code_Blocks_Projects/xboard_fork'
Running target post-build steps
echo your_password | sudo -S make -f Makefile install
[sudo] password for mehdi:
Sorry, try again.
[sudo] password for mehdi:
sudo: 1 incorrect password attempt
Process terminated with status 1 (0 minute(s), 2 second(s))
0 error(s), 0 warning(s) (0 minute(s), 2 second(s))
 


Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12129
    • Travis build status
Re: XBoard in Code::Blocks
« Reply #14 on: November 10, 2019, 06:38:42 pm »
There are graphical alternatives to sudo. Also configure supports --prefix option which could be used to redirect the installation to a user writable folder, so sudo won't be required for successful install.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Miguel Gimenez

  • Regular
  • ***
  • Posts: 383
Re: XBoard in Code::Blocks
« Reply #15 on: November 10, 2019, 07:10:48 pm »
 :o You must substitute your_password with your actual password

Offline ordak

  • Multiple posting newcomer
  • *
  • Posts: 93
Re: XBoard in Code::Blocks
« Reply #16 on: November 11, 2019, 04:39:35 pm »
I was able to compile it , now in usr/local/bin :

Name: xboard
Type: shared library (application/x-sharedlib)
Size: 1.1 MB

Parent Folder: /usr/local/bin