Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision Both sides next revision
personal:portfolio:portopt [2015/03/30 14:20]
antonello [Theorical Background]
personal:portfolio:portopt [2015/09/10 15:19]
antonello [Compilation (not needed if using a pre-compiled version)]
Line 81: Line 81:
   g++ -std=c++0x -O -shared -Wl,-soname,_portopt.so -o _portopt.so QuadProg++.o Array.o anyoption.o portopt.o portopt_wrap.o   g++ -std=c++0x -O -shared -Wl,-soname,_portopt.so -o _portopt.so QuadProg++.o Array.o anyoption.o portopt.o portopt_wrap.o
 (then please refer to the python example for usage)  (then please refer to the python example for usage) 
 +
 +If you want to change the output library name (e.g. you want to create _portopt_p3.so for python3 alongside _portopt.so for python2), do it in the %module variable of portopt.i and in the -soname and -o options of the linking command (and don't forget to use the right python included directory in the compilation command).\\
 +You can then load the correct module in your script with something like:
 +  import sys
 +  if sys.version_info < (3, 0):
 +    import portopt
 +  else:
 +    import portopt_p3 as portopt
  
 ===== Usage ===== ===== Usage =====
personal/portfolio/portopt.txt · Last modified: 2018/06/18 15:11 (external edit)
CC Attribution-Noncommercial-Share Alike 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0