PixInsight Forum
2010 July 31 20:50:05 *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Welcome to PixInsight Forum
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: New Script: MakefileGenerator  (Read 892 times)
Juan Conejero
PTeam Member
PixInsight Jedi Master
******
Posts: 1874



View Profile WWW
« on: 2009 September 13 00:52:41 »

Hi all,

I am glad to introduce a new script specifically designed for PixInsight/PCL developers: MakefileGenerator.

As its name suggests, this is a script for automatic generation of makefiles and project files for PCL-based PixInsight development projects. It covers all platforms and architectures currently supported by PixInsight: Linux/X11, Mac OS X and Windows, x86 and x86_64. Standard GNU make makefiles are generated for GCC on Linux and Mac OS X, and .vcproj XML project files for Visual C++ 2008 on Windows.

MakefileGenerator is being released under GPL v3 license. This is the script source code:

http://pteam.pixinsight.com/MakefileGenerator.js.zip

and here is a screenshot of the script's interface:



MakefileGenerator has been written primarily as an internal tool. In fact, the entire PixInsight platform is being re-built with makefiles and projects generated by this script. This is from now on an essential element of PixInsight's multiplatform development chain.

I have decided to release this script because I think it can be extremely useful for developers on the PixInsight/PCL framework. Now you don't have to worry about the correct symbols defined, or the appropriate settings and compiler optimizations for each platform: just run the script, select the directory where you have your module source code, and click OK with default script settings. This will generate all necessary makefiles and projects for all platforms.

MakefileGenerator makes just one assumption: all the source code of your module (including .cpp, .h and resource files) lies under a single directory. There can be any number of subdirectories, but one root only. As long as this is your case, MakefileGenerator will work for you.

The script has been written for the new PCL version, which still has not been published. The new PCL introduces some breaking changes that require making a few manual changes to your current PCL installation in order to use generated makefiles and .vcproj files:

* All PCL libraries (both static and dynamic) carry the -pxi filename suffix on all platforms. Consequently, denoting as <PCL> your current PCL installation directory, you have to rename:
- Linux and Mac OS X: <PCL>/lib/PCL.a as <PCL>/lib/PCL-pxi.a
- Windows: <PCL>\lib\PCL-vc9.lib as <PCL>\lib\PCL-pxi.lib

* All PCL libraries are from now on located on architecture-specific directories. You must move your PCL-pxi.a or PCL-pxi.lib to a newly created <PCL>/lib/x86 or <PCL>/lib/x86_64 directory, depending on your platform/architecture. See the new PCLLIBDIR32 and PCLLIBDIR64 environmental variables below.

* The following environmental variables must be defined on all platforms:
PCLDIR - PCL root installation directory. Usually ~/PCL or C:\PCL
PCLINCDIR - PCL include root directory, usually equal to $PCLDIR/include
PCLSRCDIR - PCL source root directory, usually equal to $PCLDIR/src
PCLLIBDIR32 - PCL 32-bit libraries directory, usually equal to $PCLDIR/lib/x86
PCLLIBDIR64 - PCL 64-bit libraries directory, usually equal to $PCLDIR/lib/x86_64
PCLBINDIR32 - PCL 32-bit binaries directory, usually equal to $PCLDIR/bin (on x86 platforms)
PCLBINDIR64 - PCL 64-bit binaries directory, usually equal to $PCLDIR/bin (on x86_64 platforms)

Let me know if you need more information, or if you find some error in generated makefiles or .vcproj files.

Enjoy!
Logged

Juan Conejero
PixInsight Development Team
http://pixinsight.com/
Carlos Milovic
PTeam Member
PixInsight Guru
****
Posts: 779



View Profile WWW
« Reply #1 on: 2009 September 13 02:00:36 »

Hi Juan

Do we have to add the -pxi suffix to all lib files (lcms, jpeg, etc), , or just the PCL one?
Logged

Regards,

Carlos Milovic F.
--------------------------------
PixInsight Project Developer
http://www.pixinsight.com
Nocturnal
PixInsight Jedi
*****
Posts: 1219



View Profile WWW
« Reply #2 on: 2009 September 17 02:16:40 »

Hi Juan,

I'm confused. Can we already use this with the current PCL or do we wait for the next release?

Also: will it be possible to install both PCL and PCL64 on the same windows box and compile both flavors provided the host is 64 bit? I notice you have one PCLDIR rather than PCLDIR32 and PCLDIR64. I could move directories around but that's rather messy.
Logged

Best,

    Sander
---
WO-M110ED+FR-III/TRF-2008
QHY-8
DSI-Pro for guiding
C11 + HyperStar3
PIxInsight, DeepSkyStacker, Fitswork, PHD, Nebulosity, CCDCap
Carlos Milovic
PTeam Member
PixInsight Guru
****
Posts: 779



View Profile WWW
« Reply #3 on: 2009 September 17 03:02:21 »

Sander, this script works well with the current PCL. Just have to do "exactly" what Juan said in his post.

I think that in the new PCL all it matters is there the PCL-pxi.lib is (and wich flavor of PCL you downloaded). If you have both versions, just keep one of them, but copy the W32 .lib file to the _x86 folder before deleting. Other than that, just define all the variables with this change: set the bin foder, for the w32 version elsewhere, or you'll end with a mix of dlls for both versions in the same folder (outputted by the compiler).

(DISCLAIMER: Correct me if I'm wrong laughing )
Logged

Regards,

Carlos Milovic F.
--------------------------------
PixInsight Project Developer
http://www.pixinsight.com
Nocturnal
PixInsight Jedi
*****
Posts: 1219



View Profile WWW
« Reply #4 on: 2009 September 17 03:47:33 »

Thanks Carlos. I should have tried it first I guess smile
Logged

Best,

    Sander
---
WO-M110ED+FR-III/TRF-2008
QHY-8
DSI-Pro for guiding
C11 + HyperStar3
PIxInsight, DeepSkyStacker, Fitswork, PHD, Nebulosity, CCDCap
Nocturnal
PixInsight Jedi
*****
Posts: 1219



View Profile WWW
« Reply #5 on: 2009 September 17 14:44:19 »

OK, I was able to recompile Carlos' sharpen module in PCL64. I'll have to install PCL32 on this system and see if I can make both 32 and 64 bit compiles work.
Logged

Best,

    Sander
---
WO-M110ED+FR-III/TRF-2008
QHY-8
DSI-Pro for guiding
C11 + HyperStar3
PIxInsight, DeepSkyStacker, Fitswork, PHD, Nebulosity, CCDCap
Juan Conejero
PTeam Member
PixInsight Jedi Master
******
Posts: 1874



View Profile WWW
« Reply #6 on: 2009 September 18 14:55:54 »

Carlos and Sander,

Yes, I know all of this is confusing - I probably shouldn't have published this script yet, since it really belongs to the new PCL and build system.

With the new PI 1.5.8 everything works extremely well for development of PCL-based modules on all supported platforms. Automatic generation of makefiles and projects is a big step forward because it simplifies cross-platform development and ensures that everything compiles and links consistently.

For your information, I am working on a new script that you'll love for sure. It generates all the initial source code of a process or file format module automatically, including parameter definitions (which I know are the hardest part to code manually). I really need this script ASAP, given the large amount of modules that Carlos has been writing during the last weeks  Shocked  Grin
Logged

Juan Conejero
PixInsight Development Team
http://pixinsight.com/
Nocturnal
PixInsight Jedi
*****
Posts: 1219



View Profile WWW
« Reply #7 on: 2009 September 18 15:06:54 »

That sounds really great Juan! Using VS 2008 there was a warning that the SSE2 option was not recognized or something like that. Minor issue. Oh and I'm pretty sure the debug settings didn't include -DPCL_DIAGNOSTICS=2. I wonder why smile
Logged

Best,

    Sander
---
WO-M110ED+FR-III/TRF-2008
QHY-8
DSI-Pro for guiding
C11 + HyperStar3
PIxInsight, DeepSkyStacker, Fitswork, PHD, Nebulosity, CCDCap
Juan Conejero
PTeam Member
PixInsight Jedi Master
******
Posts: 1874



View Profile WWW
« Reply #8 on: 2009 September 18 15:19:59 »

Thanks! That's a good point - I'll add an option to include -DPCL_DIAGNOSTICS=<n> (<n> selectable) (you know, I actually don't use diagnostics code and that's why I forgot to include it smile). I'll fix that SSE2 issue too, I have it controlled smile
Logged

Juan Conejero
PixInsight Development Team
http://pixinsight.com/
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!