Compiling module with f2py - compilation

I want to compile on a server a module using f2py with the following command :
f2py -c utils.f90 parameters.f90 helmholtz.f90 calc.f90 qgflux.f90
qgstep.f90 interface.f90 -m py_mod
but the f2py command is not available on that server. Hence, I tried to compile my module within python with the following code :
import numpy.f2py
r = numpy.f2py.run_main(['-m','py_mod','utils.f90','parameters.f90','helmholtz.f90','calc.f90','qgflux.f90','qgstep.f90','interface.f90'])
Looks like everything goes fines, at the end I get :
Wrote C/API module "py_mod" to file "./py_modmodule.c"
Fortran 90 wrappers are saved to "./py_mod-f2pywrappers2.f90"
Now the command "print(r)" returns :
{'py_mod': {'csrc': ['./py_modmodule.c',
'/usr/lib64/python3.6/site-packages/numpy/f2py/src/fortranobject.c'],
'fsrc': ['./py_mod-f2pywrappers2.f90'], 'h':
['/usr/lib64/python3.6/site-packages/numpy/f2py/src/fortranobject.h']}}
But I do not know what to do next to get the module py_mod, can you please help me ?
Regards

OK, I finally found a solution to my issue. Here is the command I used in bash :
python3.6 -m numpy.f2py -c utils.f90 parameters.f90 helmholtz.f90
calc.f90 qgflux.f90 qgstep.f90 interface.f90 -m py_mod
and it worked fine !

Related

chaincode argument error: unexpected end of JSON input

I have created a test network and I am able to install the chaincode I have created in golang. But when instantiating it I receive the following:
2020-03-24 08:00:00.843 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 04a Using default escc
2020-03-24 08:00:00.844 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 04b Using default vscc
Error: chaincode argument error: unexpected end of JSON input
If I build the code in its own directory, it compiles without problems.
I can install and instantiate the code in another development network, but not in one I have created from scratch.
Help would be appreciated!
Thanks!
Use quotation marks when referencing CC_CONSTRUCTOR variable. Otherwise, bash prioritizes inner spaces over inner quotation marks:
peer chaincode instantiate -C $CC_CHANNEL_ID -n $CC_NAME -v $CC_VERSION -c "$CC_CONSTRUCTOR" -o $ORDERER_ADDRESS
Thanks. I am setting env variables, then call the instantiate. Same variables are set for the install, which works fine.
export CC_CONSTRUCTOR='{ "Args" : [ "Message" , "Hello World - Init message" ] }'
export CC_NAME="testcc"
export CC_PATH="testcc"
export CC_VERSION="1.1"
export CC_CHANNEL_ID="testchannel"
peer chaincode instantiate -C $CC_CHANNEL_ID -n $CC_NAME -v $CC_VERSION -c $CC_CONSTRUCTOR -o $ORDERER_ADDRESS
I have tried escaping some that might need, that does not work. And again, the very same golang code and JSON constructor works on another test environment.
If I unset the CC_CONSTRUCTOR variable, I receive another error message, hence with high probability that is the problem.
In same cases, this error is generated by
const stateValue = await ctx.stub.getState(state);
when the state does not exist.
In other cases, it is because
evaluateTransaction is used instead of submitTransaction when reading states

Cef Compilation 64 bit Binaries not generated for Cocoa

CEF :
Branch : 2987
Terminal Commands for Generating binary distrib files after all the data gets downloaded
$ export GYP_DEFINES=proprietary_codecs=1 ffmpeg_branding=Chrome
$ python /Users/imfinity/Documents/CEF_2987/automate/automate-git.py --download-dir=/Users/imfinity/Documents/CEF_2987/download --branch=2987 --x64-build --force-config --force-build
$ cd /Users/imfinity/-dir/chromium/src/cef/tools
$ ./make_distrib.sh --ninja-build
ERROR : Traceback (most recent call last):
File "make_distrib.py", line 468, in
raise Exception('Missing generated header file: %s' % include)
Exception: Missing generated header file: cef_pack_resources.h
This leads to creation of : Incomplete Folder : cef_binary_3.2987.1574.g4232c4c_macosx32
Any help is appreciated!!
I tried this command
$ export GYP_DEFINES=proprietary_codecs=1 ffmpeg_branding=Chrome
$ python /Users/imfinity/Documents/CEF_20March/automate/automate-git.py --download-dir /Users/imfinity/Documents/CEF_20March/download --branch=2987 --x64-build --force-config
and finally it worked and 64 bit binaries were generated
still surprised it worked after 5 different attempts!!!

Error in TORA while implementing in ns2

When I run the code
http://wpage.unina.it/marcello.caleffi/ns2/tora.cc and
http://wpage.unina.it/marcello.caleffi/ns2/tora.h
The error I get is
invalid command name "int"
while executing
"int hdr_tora::offset_"
(file "tora.cc" line 18)
Can any one help me with this?
Well, you are not supposed to "run the code".
And : files.cc cannot be compiled individually in ns2.
Build example : tar xvf ns-allinone-2.35_gcc482.tar.gz
https://drive.google.com/file/d/0B7S255p3kFXNSGJCZ2YzUGJDVk0/view?usp=sharing
cd ns-allinone-2.35/
patch -p0 < tora_ns235.patch
https://drive.google.com/file/d/0B7S255p3kFXNQXhib1BhRlVSSm8/view?usp=sharing
./install
Tora examples : tora-files+examples.tar.gz
https://drive.google.com/file/d/0B7S255p3kFXNQ2hYb0xPcmdlWU0/view?usp=sharing
ns2

Apache Thrift 0.9.1 generate golang code , param -r don't work

I use
`thrift-0.9.1 -r -gen go aaa.thrift`
to generate golang code
(note: aaa.thrfit include bbb.thrift which defined "Body" struct)
the param -r seems doesn't work, can't find "Body" struct in ttypes.go,
but when I try to use
`thrift-0.9.1 -r -gen java aaa.thrift`
has "Body.java",
how can I generate golang code which included files?
(note:from https://github.com/apache/thrift)
I know the reason, namespace go service.demo lead to the problem
$ cd thrift
$ cd trunk
$ cd tutorial
$ thrift -r -gen go tutorial.thrift
works perfectly for me.

Steps for installing Orbfit 4.2

I'm trying to install Orbfit4.2 on a using linux mint maya edition. I'm trying to follow the on line help. I have unzipped the tared file, configured with $ ./config -0 gfortran and then $ make. Both appears to be successful. I am now trying to create the DE405 data files in the /orbfit/src/jpleph directory. I have downloaded the header.405 and the ascp*date* ascii files into the directory from JPL. I have run $ make ephemerides and get the following;
cat header.405 ascp1960.405 ascp1980.405 ascp2000.405 ascp2020.405> input.430
asc2eph.x < input.430
/bin/sh: 1: asc2eph.x: not found
make: *** [ephemerides] Error 127
(I have also used input value of 405 instead of 430)
I have also tried just running from with in
the directory
$ ./asc2eph.x which was the previous method before the Makefile was included. All I get with this is 'authors' introductory message and the flashing working box-still running 6 hrs later.
If anybody has any experience or advice with installing Orbfit 4.2 from the start or can help me move on from the above blockage I would appreciate.
Note I am a real novice and would appreciate idiot step by step guide- I'm the idiot.
Eric
The Makefile assumes that the current directory "." is in your path. This is a security risk. You can either edit the Makefile to rename these binaries:
$ diff -u Makefile.orig Makefile
--- Makefile.orig 2014-01-09 07:14:10.000000000 -0800
+++ Makefile 2014-10-21 11:40:00.850236839 -0700
## -10,7 +10,7 ##
make clean
ephemerides: input asc2eph.x
- asc2eph.x < input.430
+ ./asc2eph.x < input.430
mv JPLEPH jpleph
make clean
Or you can add . to your path (but this is insecure!) by doing
$ PATH=.:$PATH

Resources