Code::Blocks Forums

User forums => General (but related to Code::Blocks) => Topic started by: StarBootics on October 16, 2016, 07:19:21 pm

Title: Open Cascade 7.0.0 setup for Code::Blocks
Post by: StarBootics 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 (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
Title: Re: Open Cascade 7.0.0 setup for Code::Blocks
Post by: oBFusCATed on October 16, 2016, 07:33:59 pm
http://wiki.codeblocks.org/index.php/FAQ-Compiling_(errors)#Q:_What_do_I_need_to_know_when_using_3rd_party_libs.3F
Title: Re: Open Cascade 7.0.0 setup for Code::Blocks
Post by: StarBootics 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
Title: Re: Open Cascade 7.0.0 setup for Code::Blocks
Post by: oBFusCATed 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.
Title: Re: Open Cascade 7.0.0 setup for Code::Blocks
Post by: StarBootics 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
Title: Re: Open Cascade 7.0.0 setup for Code::Blocks
Post by: StarBootics 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




Title: Re: Open Cascade 7.0.0 setup for Code::Blocks
Post by: BlueHazzard on October 27, 2016, 06:52:28 pm
http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_(general)#Q:_How_do_I_report_a_compilation_problem_on_the_forums.3F
Title: Re: Open Cascade 7.0.0 setup for Code::Blocks
Post by: StarBootics 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 (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.
Title: Re: Open Cascade 7.0.0 setup for Code::Blocks
Post by: BlueHazzard 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?
Title: Re: Open Cascade 7.0.0 setup for Code::Blocks
Post by: StarBootics on October 28, 2016, 06:39:12 pm
Perhaps compiling the library with CMake directly ?
Title: Re: Open Cascade 7.0.0 setup for Code::Blocks
Post by: stahta01 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 ?
Title: Re: Open Cascade 7.0.0 setup for Code::Blocks
Post by: StarBootics 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
Title: Re: Open Cascade 7.0.0 setup for Code::Blocks
Post by: BlueHazzard 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...
Title: Re: Open Cascade 7.0.0 setup for Code::Blocks
Post by: Jenna 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.