Author Topic: Open Cascade 7.0.0 setup for Code::Blocks  (Read 7332 times)

Offline StarBootics

  • Single posting newcomer
  • *
  • Posts: 8
Open Cascade 7.0.0 setup for Code::Blocks
« on: October 16, 2016, 07:19:21 pm »
Hello everyone,

I'm currently studying Open Cascade library and installing it but so far it didn't work. According to their website https://www.opencascade.com/content/latest-release pre-generated projects are provided for Code::Blocks IDE

I have to confess I have no knowledge about *.sh files but when I read "codeblocks.sh" file I seems to be created for MacOS.
Code
#!/bin/bash

export TARGET="cbp"

source ./env.sh "$1" "$TARGET"

if [ -e "/Applications/CodeBlocks.app/Contents/MacOS/CodeBlocks" ]; then
  /Applications/CodeBlocks.app/Contents/MacOS/CodeBlocks ./adm/$WOKSTATION/cbp/OCCT.workspace
else
  codeblocks ./adm/$WOKSTATION/cbp/OCCT.workspace
fi

So my question is :

How to install this library under Linux OS (Ubuntu 16.04 x64) for using it with Code::Blocks ?

Thanks beforehand
StarBootics

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
(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 StarBootics

  • Single posting newcomer
  • *
  • Posts: 8
Re: Open Cascade 7.0.0 setup for Code::Blocks
« Reply #2 on: October 16, 2016, 11:17:16 pm »
http://wiki.codeblocks.org/index.php/FAQ-Compiling_(errors)#Q:_What_do_I_need_to_know_when_using_3rd_party_libs.3F
Thanks

I don't know why but I had to add some Search Directories in the "Global compiler settings" even if the files are in the "/usr/include/...". I was sure when the files are in that folder we don't need to specify them, the compiler are capable to find them all by it's self.

Anyway, I still have an issue but it's more related to compiling a library than setting up Code::Blocks to do it.

Best regards
StarBootics

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Open Cascade 7.0.0 setup for Code::Blocks
« Reply #3 on: October 17, 2016, 12:54:30 am »
Only /usr/include is known by default.
Any subfolder should be added manually.
Generally it is very bad idea to add paths to the global compiler settings.
It is better to add them to your project settings.
Use pkg-config or global variables.
(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 StarBootics

  • Single posting newcomer
  • *
  • Posts: 8
Re: Open Cascade 7.0.0 setup for Code::Blocks
« Reply #4 on: October 17, 2016, 02:33:23 am »
Only /usr/include is known by default.
Any subfolder should be added manually.
Generally it is very bad idea to add paths to the global compiler settings.
It is better to add them to your project settings.
Use pkg-config or global variables.

Ok I have change that, these folder are now in my project file.

Best regards
StarBootics

Offline StarBootics

  • Single posting newcomer
  • *
  • Posts: 8
Re: Open Cascade 7.0.0 setup for Code::Blocks
« Reply #5 on: October 27, 2016, 06:37:20 pm »
Hello everyone,

I need some help again about something I don't understand. I'm still trying to compile successfully OpenCascade but so far it fail saying :

Quote
(0 error, 372 warning)  built fail with error 7

This is what I don't understand you can't have "no error" and "an error" at the same time. So my question is : What kind of errors are being reported by Code::Blocks ?

I guess, syntax errors only

And if, by chance, someone know what error 7 from GCC compiler mean, this will be very helpful.

Thanks beforehand
StarBootics




« Last Edit: October 27, 2016, 10:10:15 pm by StarBootics »


Offline StarBootics

  • Single posting newcomer
  • *
  • Posts: 8
Re: Open Cascade 7.0.0 setup for Code::Blocks
« Reply #7 on: October 28, 2016, 12:10:44 am »
I am running Code::Blocks version 16.01 rev 10692 on Ubuntu Gnome x64 (version 16.10).
The compiler I use is GNU GCC version (Ubuntu 6.2.0-5ubuntu12) 6.2.0 20161005.

When I try to compile OpenCascade library, the compilation fail with 0 error 362 warning Built failed with error 7.

Build log : (Sorry too large to post it directly but for those who want to see it https://www.dropbox.com/s/sej40qsxlr2f4nq/Occt_Kernel_Build_log.zip?dl=0
Code
bin/Release/libOcctKernel.so -s) failed with error 7!
Process terminated with status -1 (110 minute(s), 15 second(s))
0 error(s), 362 warning(s) (110 minute(s), 15 second(s))

Crash report: No crash

I didn't make a lot of test since the compilation time is very very long. But I have already tried :
To compile with C++14 instead of C++11
To built the library by dropping some portions out of it (bad idea even if the *.so library is created : undefinied references ...)
but none of them worked.

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: Open Cascade 7.0.0 setup for Code::Blocks
« Reply #8 on: October 28, 2016, 12:44:32 am »
i think this error comes from
Code
execvp(/bin/sh, -c, g++ .............
and means:
Quote
#define E2BIG        7  /* Argument list too long */

so the problem seems to be that there are too many .o files to link into one library at the same time. This is not a problem of the compiler but of the ?OS? or the way how codeblocks calls the compiler... This is a problem of the project file, not specially a hard bug in c::b, but c::b should be a able to handle this correctly...

someone an idea how to fix this?
« Last Edit: October 28, 2016, 07:13:39 pm by BlueHazzard »

Offline StarBootics

  • Single posting newcomer
  • *
  • Posts: 8
Re: Open Cascade 7.0.0 setup for Code::Blocks
« Reply #9 on: October 28, 2016, 06:39:12 pm »
Perhaps compiling the library with CMake directly ?

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Open Cascade 7.0.0 setup for Code::Blocks
« Reply #10 on: October 28, 2016, 09:43:56 pm »
Good idea; to be safest I would use make files created via CMake.
But, you could try to create CB projects using CMake to see if the CB projects were created wrong or not.
But, the OP would be safer to create make files.

My guess the OP is using CB Projects created for the wrong Operating System.

Tim S.

Perhaps compiling the library with CMake directly ?
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline StarBootics

  • Single posting newcomer
  • *
  • Posts: 8
Re: Open Cascade 7.0.0 setup for Code::Blocks
« Reply #11 on: October 29, 2016, 12:44:57 am »
Problem solved !

I'm compiling as I'm writing here. I after a serious search of the opencascade-7.0.0 source code folder I have found the OCCT workspace file. The source generate several libraries instead of a single one. That was the mistake I made, trying to compile a single library...

Anyway in my experience I have exceed the limit in size but it will be nice for the future to know what is the maximum size for a library.

Best regards
StarBootics
« Last Edit: October 29, 2016, 12:57:14 am by StarBootics »

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: Open Cascade 7.0.0 setup for Code::Blocks
« Reply #12 on: October 29, 2016, 02:50:53 pm »
Anyway in my experience I have exceed the limit in size but it will be nice for the future to know what is the maximum size for a library.

i think too that this is a problem (or a bug) in codeblocks.... The maximum size is os or even distribution dependent...

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Open Cascade 7.0.0 setup for Code::Blocks
« Reply #13 on: October 30, 2016, 11:04:13 am »
Anyway in my experience I have exceed the limit in size but it will be nice for the future to know what is the maximum size for a library.

i think too that this is a problem (or a bug) in codeblocks.... The maximum size is os or even distribution dependent...
It's wxExecute, which limits the size (or has limited) as far as I know.
Besides any OS-limits, of course.