Re: [Patch 2.3.2] Scons: fixes for Windows and Linux

Alpert, Reed <reed.alpert@...>

Yes, that looks fine, do you want me to resubmit the patch with the changes?






Reed Alpert | Corporate & Investment Bank | Market Data Services | J.P. Morgan | 4 Metrotech Center, 23rd Floor, Brooklyn, NY 11245 | T: 718.242.5198  | M: 917.414.4613 | reed.alpert@...

Alternate Contact:  CIB PIM Trading Technology Solutions NA | CIB_PIM_Trading_Technology_Solutions_NA@...


From: openmama-dev-bounces@... [mailto:openmama-dev-bounces@...] On Behalf Of Gary Molloy
Sent: Monday, April 27, 2015 6:17 PM
To: Reed Alpert; openmama-dev@...
Subject: Re: [Openmama-dev] [Patch 2.3.2] Scons: fixes for Windows and Linux


Hi Reed,


I was just wondering if you had time to review my comments?





From: Gary Molloy
Sent: 17 April 2015 18:01
To: Reed Alpert; openmama-dev@...
Subject: RE: [Openmama-dev] [Patch 2.3.2] Scons: fixes for Windows and Linux


Hey Reed,


Thank you for your patch.  I have logged this as BZ-188 for you.


Your patch looks good.  I noticed just a few minor things:


The following can just be “./src/c/mama”:


-INPUT                  = ./src/c/mama ./src/enterprise/c/mama

+INPUT                  = ./src/c/mama ./src/c/mama


And the same could be applied to mama/c_cpp/






Gary Molloy – SR Labs

Adelaide Exchange | 24-26 Adelaide Street | Belfast | BT2 8GD

Tel: +44 28 9099 7580  Ext 3397



From: openmama-dev-bounces@... [mailto:openmama-dev-bounces@...] On Behalf Of Reed Alpert
Sent: 28 March 2015 21:19
To: openmama-dev@...
Subject: [Openmama-dev] [Patch 2.3.2] Scons: fixes for Windows and Linux




These are against the next branch.


Fixes for Windows build using docs, testtools, and unittests.
Fixes for using DOS commands instead of GNU/Linux commands.
Remove reference to 'enterprise' in path names.
Add junit_home as a cmd line parm.
Add Visual Studio 11 and 12 as options (leave 10 as default).
Add MSVS_VERSION (along with existing MSVC_VERSION) to tell scons what Visual Studio version to use.







diff --git a/mama/c_cpp/ b/mama/c_cpp/

index 77e3157..ece0710 100644

--- a/mama/c_cpp/

+++ b/mama/c_cpp/

@@ -121,14 +121,13 @@ if env['with_testtools'] == True and 'dynamic' in env['build']:

 if (    not Media.has_key('mama/c_cpp/docs')

         and env['build'] == 'dynamic'

         and not env.GetOption('clean')

+        and env['product'] == 'mama'

         and env['with_docs'] == True ):


     cdoc = env.Doxygen('')

     cppdoc = env.Doxygen('')


-    env.Command( '$prefix/doc/mama/images', cdoc, 'mkdir $TARGET && cp -rf %s\mama\c_cpp\doc\images\* $TARGET' % ( env['TOPLEVEL'] ) )

-    env.Command( '$prefix/doc/mama/c/html', cdoc, 'mkdir $TARGET && cp -rf %s\mama\c_cpp\doc\c\html\* $TARGET' % ( env['TOPLEVEL'] ) )

-    env.Command( '$prefix/doc/mama/cpp/html', cppdoc, 'mkdir $TARGET && cp -rf %s\mama\c_cpp\doc\cpp\html\* $TARGET' % ( env['TOPLEVEL'] ) )

+    env.Command( '$prefix/doc/mama', '', 'mkdir $TARGET && xcopy /q /s /e /y %s\mama\c_cpp\doc\* $TARGET' % ( env['TOPLEVEL'] ) )


     env.Clean( cdoc, '%s/mama/c_cpp/doc/c' % (env['TOPLEVEL']) )

     env.Clean( cppdoc, '%s/mama/c_cpp/doc/cpp' % (env['TOPLEVEL']) )

diff --git a/mama/c_cpp/ b/mama/c_cpp/

index 9e03518..b92b005 100644

--- a/mama/c_cpp/

+++ b/mama/c_cpp/

@@ -754,7 +754,7 @@ WARN_LOGFILE           =

 # spaces.

 # Note: If this tag is empty the current directory is searched.


-INPUT                  = ./src/c/mama ./src/enterprise/c/mama

+INPUT                  = ./src/c/mama ./src/c/mama


 # This tag can be used to specify the character encoding of the source files

 # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses

diff --git a/mama/jni/SConscript b/mama/jni/SConscript

index 6d4173d..61a3570 100644

--- a/mama/jni/SConscript

+++ b/mama/jni/SConscript

@@ -20,6 +20,9 @@ testtools_source = Split("""


 testtools = []


+unittest_source = Glob('src/junittests')

+unittest = []


 jExamples = Glob('src/com/wombat/mama/examples/*java')


 version = env['versions']['mama']['releaseString']

@@ -43,14 +46,20 @@ if env['with_testtools'] == True:

     for t in testtools_source:

         testtools.append( env.Java( 'classes', t ) )


+if env['with_unittest'] == True:

+    for t in unittest_source:

+        unittest.append( env.Java( 'classes', t ) )

+        env.Append(JAVACLASSPATH = ('$junit_home/junit.jar'))


 env.Depends( mama_classes, common_classes )

 env.Depends( testtools, mama_classes )

+env.Depends( unittest, mama_classes )


 # Builds all of the header files which is unnecessary but no reason not to

 # do this

 headers = env.JavaH(target=Dir('src/c/mamajni').abspath,source= [ mama_classes, common_classes ])


-env.Depends( headers, [ mama_classes, common_classes, testtools ] )

+env.Depends( headers, [ mama_classes, common_classes, testtools, unittest ] )


 jar = env.Jar(target='mamajni.jar', source='classes', JARCHDIR = Dir('classes').abspath  )


diff --git a/mamda/c_cpp/ b/mamda/c_cpp/

index 4c63b51..0a67d48 100644

--- a/mamda/c_cpp/

+++ b/mamda/c_cpp/

@@ -113,7 +113,7 @@ if env['with_unittest'] == True:

 if ( env['with_docs'] == True and not Media.has_key('mamda/c_cpp/docs') and env['build'] == 'dynamic' and not env.GetOption('clean') ):

    cppdoc = env.Doxygen('')


-   env.Command( '$prefix/doc/mamda/cpp/html', cppdoc, 'mkdir $TARGET && cp -rf %s\mamda\c_cpp\doc\cpp\html\* $TARGET' % ( env['TOPLEVEL'] ) )

+   env.Command( '$prefix/doc/mamda', cppdoc, 'mkdir $TARGET && xcopy /q /s /e /y  %s\mamda\c_cpp\doc\* $TARGET' % ( env['TOPLEVEL'] ) )


    env.Clean( cppdoc, '%s/mamda/c_cpp/doc/cpp' % (env['TOPLEVEL']) )


diff --git a/site_scons/community/ b/site_scons/community/

index e1791e2..4bbacc5 100644

--- a/site_scons/community/

+++ b/site_scons/community/

@@ -26,6 +26,7 @@ def get_command_line_opts( host, products, VERSIONS ):

        BoolVariable('with_examples','Build with test tools',True),

        BoolVariable('entitled','Whether the build is entitled or unentitled',False),

        PathVariable('gtest_home','Path to Google Test home',None, PathVariable.PathIsDir),

+       PathVariable('junit_home','Path to Junit home',None, PathVariable.PathIsDir),

        ListVariable('middleware','Middleware(s) to be compiled in', 'avis', names = ['avis', 'qpid'] ),

        ('jobs', 'Number of scons threads to spawn, if n is passed the number of availabe cores is calculated and used', '1'),


@@ -39,7 +40,7 @@ def get_command_line_opts( host, products, VERSIONS ):

             PathVariable('qpid_home', 'Path to QPID Proton Libraries',

                           'c:\\proton', PathVariable.PathAccept),

             EnumVariable('vsver','Visual Studio Version to use', '10.0',

-                allowed_values=('8.0','9.0','10.0')),

+                allowed_values=('8.0','9.0','10.0','11.0','12.0')),

             EnumVariable('product', 'Product to be built', 'mamda',

                      allowed_values=( products )),

             EnumVariable('dotnet_version', 'Dotnet Version used to determine framework directory', '2.0',

@@ -63,6 +64,8 @@ def get_command_line_opts( host, products, VERSIONS ):

             EnumVariable('product', 'Product to be built', 'mamda',

                          #mamda all is a windows only build

                          allowed_values=( [ x for x in products if x != "mamdaall" ] )),

+            EnumVariable('target_arch', 'Specifies if the build should target 32 or 64 bit architectures.',

+                          host['arch'], allowed_values=['x86', 'x86_64']),

             EnumVariable( 'compiler', 'Compiler to use for building OpenMAMA',

                          'default', allowed_values=('default', 'gcc', 'clang', 'clang-analyzer')),


diff --git a/site_scons/community/ b/site_scons/community/

index 362f697..80c241d 100644

--- a/site_scons/community/

+++ b/site_scons/community/

@@ -64,8 +64,10 @@ class Windows:

             env = Environment(ENV={

                 'JAVA_HOME': '%s' % (optsEnv['java_home']),

                 'PATH': '%s:%s\\bin' % (os.environ['PATH'], optsEnv['java_home']),

-                'MSVC_VERSION' : '%s' %(optsEnv['vsver'])},

+                },

                 tools = tools,

+                MSVC_VERSION = optsEnv['vsver'],

+                MSVS_VERSION = optsEnv['vsver'],

                 TARGET_ARCH = optsEnv['target_arch'])


             #ConfigureJNI searches os.env for java_home not env['ENV']['JAVA_HOME'] 

@@ -78,7 +80,7 @@ class Windows:

             env['JAVAH'] = 'javah'



-            env = Environment(ENV={'PATH': '%s' % (os.environ['PATH'])}, MSVC_VERSION = optsEnv['vsver'], tools = tools, TARGET_ARCH = optsEnv['target_arch'])

+            env = Environment(ENV={'PATH': '%s' % (os.environ['PATH'])}, MSVC_VERSION = optsEnv['vsver'], MSVS_VERSION = optsEnv['vsver'], tools = tools, TARGET_ARCH = optsEnv['target_arch'])


         env['SPAWN'] = logger.log_output

         env['PRINT_CMD_LINE_FUNC'] = logger.log_command

@@ -196,7 +198,7 @@ class Windows:

     # Configures all of the appropriate environment variables for windows.

     def configure(self, env ):

         env.Append( CPPDEFINES = ['WIN32'] )

-        env.Append( CCFLAGS = ['-EHsc','/GR','/FIwombat\\targetsxs.h'] )

+        env.Append( CCFLAGS = ['/EHsc','/GR','/FIwombat\\targetsxs.h'] )

         env.Append( LINKFLAGS =['/MANIFEST'] )

         env.Append( CCPDBFLAGS = '/Fd${TARGET}.pdb' )

         env.Append( PDB = '${TARGET.base}.pdb')


This communication is for informational purposes only. It is not intended as an offer or solicitation for the purchase or sale of any financial instrument or as an official confirmation of any transaction. All market prices, data and other information are not warranted as to completeness or accuracy and are subject to change without notice. Any comments or statements made herein do not necessarily reflect those of JPMorgan Chase & Co., its subsidiaries and affiliates (collectively, "JPMC"). This transmission may contain information that is proprietary, privileged, confidential and/or exempt from disclosure under applicable law. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, or use of the information contained herein (including any reliance thereon) is STRICTLY PROHIBITED. If you received this transmission in error, please immediately contact the sender and destroy the material in its entirety, whether in electronic or hard copy format. Although this transmission and any attachments are believed to be free of any attachments are believed to be free of any virus or other defect that might affect any computer system into which it is received and opened, it is the responsibility of the recipient to ensure that it is virus free and no responsibility is accepted by JPMC for any loss or damage arising in any way from its use. Please note that any electronic communication that is conducted within or through JPMC's systems is subject to interception, monitoring, review, retention and external production in accordance with JPMC's policy and local laws, rules and regulations; may be stored or otherwise processed in countries other than the country in which you are located; and will be treated in accordance with JPMC policies and applicable laws and regulations. Please refer to for disclosures relating to European legal entities.

Join to automatically receive all group messages.