Hi guys,

By coincidence, I was working on this aspect this afternoon.
In a nutshell, I'd like to use Emacs in text mode in certain 
circumstances. In this case, I need command line tools.

My message is not directly related to SCons, but it presents some 
similar experiences too. In the end, I describe a difficulty I found and 
not yet solved.


1. directory layout

. I came from the Java world, specially using Maven, which basically 
means we may have several source folders. At least, we have two folders: 
one for main source files (many packages) and one for test files (many 
packages too).
. There are usually folders reserved for "resources" (not code) which 
usually needs to be packaged together to the code.
. We also usually build stuff in the "target" folder.

This is the directory layout:

src
   main
     x10
         (main source code here)
     resources
         (lots of files/folders here)
   test
     x10
         (test code here)
     resources
         (lots of files/folder here)
target
     (generated binaries here)




2. In order to build my application, I've done the following:

$ cd target

$ x10c++ \
     -o test \
     -MAIN_CLASS=com.jquantlib.math.statistics.StatisticsTests \
     `find ~/workspace-x10/xql-statistics/src/main/x10 \
          -type f -name '*.x10' `  \
     `find ~/workspace-x10/xql-statistics/src/test/x10 \
          -type f -name '*.x10' `  \


3. Running the application

$ ./test
43

Great! It builds fine and the application executes :)




4. Difficulties


I said it works.
Well... it works only on my laptop, which is a i*86 thing

$ uname
Linux acer4150 2.6.35-22-generic #35-Ubuntu SMP Sat Oct 16 20:36:48 UTC 
2010 i686 GNU/Linux


It does not run on my desktop, which is a x86_64 thing:

$ uname
Linux terra 2.6.32-5-amd64 #1 SMP Fri Oct 15 00:56:30 UTC 2010 x86_64 
GNU/Linux


The error message is:


x10c++: /usr/bin/ld: skipping incompatible 
/opt/JavaIDE/x10-2.1.0-linux-x86_64/lib/libgc.a when searching for -lgc
      /usr/bin/ld: cannot find -lgc
      collect2: ld returned 1 exit status
x10c++: Non-zero return code: 1
2 errors.



Looking at the build.xml script (intended to build the X10 
distribution), I saw that there's no way to make difference between 32 
bits and 64 bits on Linux, like this:


UNAME=`uname -smp | sed -e 's/ /,/g'` 

FILE_SEP='/'; if [[ "$UNAME" = CYGWIN* ]]; then FILE_SEP='\\'; fi 

PATH_SEP=':'; if [[ "$UNAME" = CYGWIN* ]]; then PATH_SEP=';'; fi 

[ -n "$X10_PLATFORM" ] || \ 

case "$UNAME" in 

   CYGWIN*,i*86,*) export X10_PLATFORM='win32_x86';; 

   Linux,*86*,*) export X10_PLATFORM='linux_x86';; 

   Linux,ppc*,*) export X10_PLATFORM='linux_ppc';; 

   AIX,*,powerpc) export X10_PLATFORM='aix_ppc';; 

   Darwin,*,i*86) export X10_PLATFORM='macosx_x86';; 

   Darwin,*,powerpc) export X10_PLATFORM='macosx_ppc';; 

   SunOS,*,sparc) export X10_PLATFORM='sunos_sparc';; 

   FreeBSD,*64*,*) export X10_PLATFORM='freebsd_amd64';; 

   *) echo "Unrecognized platform: '$UNAME'"; exit 1;; 

esac 

# NOTE: the above assumes that Cygwin==win32 (probably valid)



Observe that "Linux,*86*,*" matches both Linux,i686 and Linux,x86_64 :(


I've tried to build X10 from sources and the error persists.
Just in case, I've downloaded again

        x10-2.1.0_linux_x86_64.tgz

... and tried x10c++ again from it but it fails.


In fact, there's a possibility that my desktop is screwed up.
I admit I need to reinstall the entire box from scratch.

So, I'd like to hear from you guys if you are building on Linux x86_64 
as expected, without troubles.




Just a final note:

x10-2.1.0_linux_x86_64.tgz suggests that it is a tar.gz file.
In fact, it is not!

$ file x10-2.1.0_linux_x86_64.tgz
x10-2.1.0_linux_x86_64.tgz: POSIX tar archive (GNU)



Thanks a lot :)


Richard Gomes
M: +44(77)9955-6813
http://tinyurl.com/frgomes
twitter: frgomes

JQuantLib is a library for Quantitative Finance written in Java.
http://www.jquantlib.org/
twitter: jquantlib

On 04/11/10 23:49, Josh Milthorpe wrote:
> Hi Russel,
>
> x10c++ does handle multiple source X10 files, including checking whether
> the file has changed since the last compilation.  It will search for any
> imported X10 classes in 'sourcepath'.  I typically compile to a separate
> target directory, so that my X10 source dirs don't get filled up with
> *.cc and *.h files.  For example:
>
> x10c++ -sourcepath .:${other-src-dir} -d ${target-dir} MyClass.x10
>
> By default this is a dynamic linking process so you will of course need
> the X10 libraries in your library path when running the executable.
>
> We use ant for all our builds.   Feel free to browse the build.xml files
> for our software, HG repo linked to from
> http://cs.anu.edu.au/~Josh.Milthorpe/anuchem.html
> There was talk a while back of creating specific x10c/x10c++ tasks for
> ant, but no movement so far. http://jira.codehaus.org/browse/XTENLANG-356
>
> I haven't tried SCons with X10 - sounds like you just volunteered :-)
>
> Cheers,
>
> Josh
>
> Russel Winder wrote:
>> I am not sure which tools for compilation of X10 programs people are
>> using.  Is anyone using SCons?  Would there be any interest in creating
>> a SCons tool for X10?
>>
>> Compiling X10 via the Java route clearly leads to having many classes
>> each in a separate file.  The compilation strategy is clear.
>>
>> When compiling via the C++ route, there seems to be an indication that
>> all the X10 code is in a single file, though I am sure this is not what
>> people are actually doing.  I suspect this is a RTFM but can someone
>> point me at information on the canonical multifile process for compiling
>> X10 via the C++ route.
>>
>> Thanks.
>>
>>
>
>
> ------------------------------------------------------------------------------
> The Next 800 Companies to Lead America's Growth: New Video Whitepaper
> David G. Thomson, author of the best-selling book "Blueprint to a
> Billion" shares his insights and actions to help propel your
> business during the next growth cycle. Listen Now!
> http://p.sf.net/sfu/SAP-dev2dev
> _______________________________________________
> X10-users mailing list
> X10-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/x10-users
>

------------------------------------------------------------------------------
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book "Blueprint to a 
Billion" shares his insights and actions to help propel your 
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
_______________________________________________
X10-users mailing list
X10-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/x10-users

Reply via email to