Author Topic: First step^H^H^H^Hfailures with PCL  (Read 6529 times)

Offline David Serrano

  • PTeam Member
  • PixInsight Guru
  • ****
  • Posts: 503
First step^H^H^H^Hfailures with PCL
« on: 2007 November 06 13:37:37 »
I've finally begun with this C++ "tongue" (note for english speakers: in spanish we use the same word for both "tongue" and "language" ;)). This is going to be a nightmare for everybody: me as a novice C++ coder and you unwary supporters ;). Well, these are my problems and suggestions:


a) Compiling is somewhat painful:

Code: [Select]
$ cp -a /usr/lib/pixinsight/source/modules/processes/Geometry .  ## copy tree to my working directory
$ cd Geometry/Release
$ make
[ blah blah, compilation successful ]
$ rm libGeometry-pm32.so
$ make
make: Nothing to be done for `ChannelMatchInstance.d'.


Erm, no, of course there's nothing to be done for that file, but there's another missing file and I want it back!

Code: [Select]
$ rm ChannelMatchInstance.d
$ make
make: Nothing to be done for `ChannelMatchInterface.d'.


Hmm... so do I have to 'make clean' everytime and rebuild the entire module, just to find that I forgot that typical semicolon (Murphy will take care of that) and have to rebuild again? (side note: I use vim for coding, so guess what I think of those fancy IDEs ;)).


b) Wasn't able to "reduce" or "strip" the module. I edited subdir.mk and removed all references to source files except for ChannelMatch*.*. Compiled and tried to load the module in PixInsight (after disabling the original Geometry-pm32.so) but the application doesn't find it. I guess that the module lacks some hooks and thus the application refuses to load it.


c) When loading a module in PixInsight, I have to type the path to my working directory every time I launch the "Install modules" dialog. It would be nice that the application remembered this, and the state of the "Recursive" checkbox too. My working directory doesn't appear in the drop-down after searching.


d) Anyway, just inserted a comment in ChannelMatchInstance.cpp. Compilation successful, but when I try to load it, PixInsight throws an "Unknown exception" (by running xmessage) and then "Module initialization failed: Exit code: 1" (in a PixInsight dialog).


My general impression about this is that my javascript evenings are by far more productive than this ;^).
--
 David Serrano

Offline David Serrano

  • PTeam Member
  • PixInsight Guru
  • ****
  • Posts: 503
Re: First step^H^H^H^Hfailures with PCL
« Reply #1 on: 2007 November 07 12:51:00 »
Quote from: "David Serrano"
d) Anyway, just inserted a comment in ChannelMatchInstance.cpp. Compilation successful, but when I try to load it, PixInsight throws an "Unknown exception" (by running xmessage) and then "Module initialization failed: Exit code: 1" (in a PixInsight dialog).


Forget it, this first battle is won 8).
--
 David Serrano

Offline Carlos Milovic

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2172
  • Join the dark side... we have cookies
    • http://www.astrophoto.cl
First step^H^H^H^Hfailures with PCL
« Reply #2 on: 2007 November 07 18:37:07 »
As I said to you throught msnm... Wellcome to the Jungle ;)
Regards,

Carlos Milovic F.
--------------------------------
PixInsight Project Developer
http://www.pixinsight.com

Offline David Serrano

  • PTeam Member
  • PixInsight Guru
  • ****
  • Posts: 503
Re: First step^H^H^H^Hfailures with PCL
« Reply #3 on: 2007 November 12 11:19:46 »
Quote from: "David Serrano"
a) Compiling is somewhat painful:


Another battle won :). Removed the following parameters:

Code: [Select]
-MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)"

and the $(CPP_DEPS) definition from the file subdir.mk. Now all those *.d files are not generated, and make behaves as I expect:

Code: [Select]
$ make PCLDIR=/usr/lib/pixinsight
[ blah blah, compilation successful ]

$ touch ../CropProcess.cpp    ## simulate the edition of one file
$ time make PCLDIR=/usr/lib/pixinsight
Building file: ../CropProcess.cpp
Invoking: GCC C++ Compiler
g++[ blah blah ]
Finished building: ../CropProcess.cpp
 
Building target: libGeometry-pm32.so
Invoking: GCC C++ Linker
g++[ blah blah ]
Finished building target: libGeometry-pm32.so
 
real: 2.060, user: 1.848, sys: 0.204
$ _


Done, module rebuilt in 2 seconds :).


Quote from: "David Serrano"
b) Wasn't able to "reduce" or "strip" the module.


No longer necessary. I only tried this in order to reduce the compilation time.

So, the only outstanding issue is this:

Quote from: "David Serrano"
c) [...] It would be nice that the application remembered this, and the state of the "Recursive" checkbox too.
--
 David Serrano