Why is so slow ???
- StarBootics
- Addict

- Posts: 1006
- Joined: Sun Jul 07, 2013 11:35 am
- Location: Canada
Why is so slow ???
Hello everyone,
98 minutes and 3 seconds compiling then it fail because of a missing header file. My estimate for the total compiling time will be around 2 hours. Why is so slow ??? OK it's a fairly large library, that being said I don't know about how the PureBasic compiler will perform with comparable source code since my largest project has almost 32 000 lines of code and took only few seconds to compile.
I really need find a better way to write good C++ code the first shot otherwise I will loose a lot of time. This is my adventure of the day compiling the OpenCascade library with few extra of my own in it.
Best regards
StarBootics
98 minutes and 3 seconds compiling then it fail because of a missing header file. My estimate for the total compiling time will be around 2 hours. Why is so slow ??? OK it's a fairly large library, that being said I don't know about how the PureBasic compiler will perform with comparable source code since my largest project has almost 32 000 lines of code and took only few seconds to compile.
I really need find a better way to write good C++ code the first shot otherwise I will loose a lot of time. This is my adventure of the day compiling the OpenCascade library with few extra of my own in it.
Best regards
StarBootics
The Stone Age did not end due to a shortage of stones !
Re: Why is so slow ???
C++ compilers are extremely fast. The problem is that they have to do way too much work
by re-compiling headers over and over again. Unfortunately, this is a known problem that has
its origins in the memory constraints of early computer systems and has been carried on
due to backwards compatibility.
C++ might get module support at some point in time that will address this problem.
In the meantime, buy faster hardware.
by re-compiling headers over and over again. Unfortunately, this is a known problem that has
its origins in the memory constraints of early computer systems and has been carried on
due to backwards compatibility.
C++ might get module support at some point in time that will address this problem.
In the meantime, buy faster hardware.
Blog: Why Does It Suck? (http://whydoesitsuck.com/)
"You can disagree with me as much as you want, but during this talk, by definition, anybody who disagrees is stupid and ugly."
- Linus Torvalds
-
DarkDragon
- Addict

- Posts: 2347
- Joined: Mon Jun 02, 2003 9:16 am
- Location: Germany
- Contact:
Re: Why is so slow ???
Also don't #include in header files, only in source files. Use forward declaration in header files instead. Also use #pragma once instead of guards (or in combination) where possible.
bye,
Daniel
Daniel
- StarBootics
- Addict

- Posts: 1006
- Joined: Sun Jul 07, 2013 11:35 am
- Location: Canada
Re: Why is so slow ???
The problem about OpenCascade many classes source code are split in 3 files, *.cxx, *.hxx and *.lxx. So the compiler have to open 3 files most of the time for every classes. Some of these classes has been written back in 1992-93 or so and never been updated since then.DarkDragon wrote:Also don't #include in header files, only in source files. Use forward declaration in header files instead. Also use #pragma once instead of guards (or in combination) where possible.
To make a long story short the source code is very old. Even if I'm capable of playing with C++ programming I'm not as good as I'm with PureBasic. It's normal I'm working with PB since version 3.81 if I recall correctly. What I'm doing right now is highly experimental for the moment and modifying 14 627 files is not an easy task.
Edit : Apparently the source I'm trying to use is broken. I'm give it another try if it didn't work I will switch to the OCE (Opencascade Community Edition). I have copied the missing file from this source to make another test.
Best regards
StarBootics
The Stone Age did not end due to a shortage of stones !
Re: Why is so slow ???
a tool like Filemon/Process Monitor might show how long its getting stuck on certain file(s)
Re: Why is so slow ???
What DarkDragon said is correct, although probably of limited use to you since you did not write the code.
So basically, the only thing you can do is ensure that your hardware is adequate and that your build process
is being paralellized correctly (which depends on the build system you're using).
So basically, the only thing you can do is ensure that your hardware is adequate and that your build process
is being paralellized correctly (which depends on the build system you're using).
Blog: Why Does It Suck? (http://whydoesitsuck.com/)
"You can disagree with me as much as you want, but during this talk, by definition, anybody who disagrees is stupid and ugly."
- Linus Torvalds
Re: Why is so slow ???
For OGRE compiling (which is very very large) we used precompiled headers and it reduced a lot the compiling time (may be x3)
- StarBootics
- Addict

- Posts: 1006
- Joined: Sun Jul 07, 2013 11:35 am
- Location: Canada
Re: Why is so slow ???
Hello everyone,
@Shield : For the moment I will have to stick with my current computer since I don't have any money for a better computer.
I'm just beginning with OpenCascade but what I really need is just the modeling part of the library. The stuff needed to make the geometry, the stuff needed to make the topology, the stuff that will use the Topology to make the body (extrusion, revolution and so on) and finally the conversion to a Mesh for rendering.
I think I can drop large portion of the library and keep only the essential. Since I'm under Linux the Direct3D and Windows NT stuff have been dropped already. Tlc/Tk I'm not sure about that just yet but I think it can be dropped too.
Best regards
StarBootics
@Shield : For the moment I will have to stick with my current computer since I don't have any money for a better computer.
I'm just beginning with OpenCascade but what I really need is just the modeling part of the library. The stuff needed to make the geometry, the stuff needed to make the topology, the stuff that will use the Topology to make the body (extrusion, revolution and so on) and finally the conversion to a Mesh for rendering.
I think I can drop large portion of the library and keep only the essential. Since I'm under Linux the Direct3D and Windows NT stuff have been dropped already. Tlc/Tk I'm not sure about that just yet but I think it can be dropped too.
Best regards
StarBootics
The Stone Age did not end due to a shortage of stones !
- StarBootics
- Addict

- Posts: 1006
- Joined: Sun Jul 07, 2013 11:35 am
- Location: Canada
Re: Why is so slow ???
Hello everyone,
My journey with OpenCascade continues...
Since I have updated my Ubuntu Gnome from 16.04 to 16.10 I'm blocked with PureBasic by this bug http://www.purebasic.fr/english/viewtop ... 23&t=66798
Edit : I got it : failed with error 7!
Best regards
StarBootics
My journey with OpenCascade continues...
How I'm supposed to built successfully if the compiler don't telling me where to look ?||=== Build failed: 0 error(s), 372 warning(s) (113 minute(s), 7 second(s)) ===|
Since I have updated my Ubuntu Gnome from 16.04 to 16.10 I'm blocked with PureBasic by this bug http://www.purebasic.fr/english/viewtop ... 23&t=66798
Edit : I got it : failed with error 7!
Best regards
StarBootics
The Stone Age did not end due to a shortage of stones !
- StarBootics
- Addict

- Posts: 1006
- Joined: Sun Jul 07, 2013 11:35 am
- Location: Canada
Re: Why is so slow ???
Hello everyone,
Finally I have found the meaning of the failed with error 7 : It means /* Argument list too long */.
In other words the library is simply too large to be handled by Code::Blocks IDE and generate the *.so file.
Ok now let's study how to use CMake to compile a project.
Best regards
StarBootics
Finally I have found the meaning of the failed with error 7 : It means /* Argument list too long */.
In other words the library is simply too large to be handled by Code::Blocks IDE and generate the *.so file.
Ok now let's study how to use CMake to compile a project.
Best regards
StarBootics
The Stone Age did not end due to a shortage of stones !
Re: Why is so slow ???
I use Cmake from the terminal, in your case you make a new folder in the oce directory and name the folder build, then cd into that folder and
cmake ..
./configure
make
make test
just for fun I built oce, but the tests failed, so no good.
cmake ..
./configure
make
make test
just for fun I built oce, but the tests failed, so no good.
- StarBootics
- Addict

- Posts: 1006
- Joined: Sun Jul 07, 2013 11:35 am
- Location: Canada
Re: Why is so slow ???
Hello everyone,
I finally understand my mistake, I'm trying to generate a super-large library, too large for the system to handle. But I have searched the source code folder and have finally found the Code::Blocks workspace file containing many project. Each project generate a library. That was my mistake.
So the real work will start soon. Stay tune !
Best regards
StarBootics
I finally understand my mistake, I'm trying to generate a super-large library, too large for the system to handle. But I have searched the source code folder and have finally found the Code::Blocks workspace file containing many project. Each project generate a library. That was my mistake.
So the real work will start soon. Stay tune !
Best regards
StarBootics
The Stone Age did not end due to a shortage of stones !
Re: Utilizing C++ libraries with PureBasic
Hello StarBootics,
Stumbled over this interesting thread.
I hope you got it working and are happy with your achievement.
If you didn't get it working, at least you learned a lot.
Now that PureBasic compiles to C, the binding to C++ libraries might be easier...
Take care
fsw
Stumbled over this interesting thread.
I hope you got it working and are happy with your achievement.
If you didn't get it working, at least you learned a lot.
Now that PureBasic compiles to C, the binding to C++ libraries might be easier...
Take care
fsw
I am to provide the public with beneficial shocks.
Alfred Hitshock
Re: Why is so slow ???
What's taking that long? PureBasic? You didn't say. If it's PureBasic, then I'm very concerned.

