Giter Site home page Giter Site logo

snopt.jl's People

Contributors

andrewning avatar dingraha avatar jaredthomas68 avatar moore54 avatar rymanderson avatar taylormcd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

snopt.jl's Issues

Integer upper bounds, lower bounds, and starting point

MWE:

function matyas_snopt(x)
    f = 0.26 * (x[1]^2 + x[2]^2) - 0.48 * x[1] * x[2]
    c = []
    fail = false
    return f, c, fail
end
x0 = [5;7]
lb = [-10.0; -10.0]
ub = [10.0; 10.0]
options = []
xopt, fopt, info = snopt(matyas_snopt, x0, lb, ub, options)

Returns ([5, 7], 4.661778256194974e-9, “Finished successfully: optimality conditions satisfied”) when it should return [0.0, 0.0]

Print SNOPT iteration history to terminal?

Hi,

Is there a way to view the SNOPT iteration log directly to the terminal/REPL as it runs? The examples I ran all appear to print these details to an external file.

Large integer return as 'xopt' - SNOPT-7.2.11

I am getting a vector of large integers as the solution of my problem.

xopt, fopt, info = snopt(prob, x0, xl, xu, options)
println(xopt[1])

The result is
4647443604925490822
The number in 'snopt-print.out' is correct.

It works fine for the test problems.

Not enough memory

Line 208 of Snopt.jl has

# working arrays
lencw = 500 + (n+nF)
cw = Array{UInt8}(lencw, 8)
leniw = 500 + 100*(n+nF)
iw = Array{Int32}(leniw)
lenrw = 500 + 200*(n+nF)
rw = Array{Float64}(lenrw)

which all of us in the lab have had to change to:

# working arrays
lencw = 500 + (n+nF)*5
cw = Array{UInt8}(lencw, 8)
leniw = 500 + 100*(n+nF)*5
iw = Array{Int32}(leniw)
lenrw = 500 + 200*(n+nF)*5
rw = Array{Float64}(lenrw)

because it seems to not always have enough memory. I'll push these changes unless Dr. Ning has a different way.

Snopt version

I am trying to use your package but having issues calling functions like openfiles_ etc. Which version of Snopt does this assume ?

Printing Summary at Major and Minor Iterations During Optimization

It would be great to get updates on the status of optimization at major and minor iterations during optimization in the terminal (i.e., the default printing behavior of SNOPT when used directly or through the c-interface). The output files are sufficient but having the ability to observe the status of optimization directly from the terminal is a nice quality of life improvement over files alone.

I did not notice anything in the Snopt.jl source code which explicitly adjusts SNOPT's printing behavior, so I expect this is an issue with the Julia/Fortran interoperability?

P.S. Thank you for developing this package. I look forward to using it.

Are infeasible constraints sometimes ignored?

Hello,
Thank you for making this package open source. I am wondering why infeasible constraints are sometimes ignored in my installation. The following example:

function f(g, df, dg, x, deriv)
    g[1] = 10. + x[1]
    return x[1], false
end

lx = [0.]
ux = [1.]
lg = [0.]
ug = [1.]
x0 = [0.5]

options = Dict(
    "Derivative option" => 0
)
rows = [1]
cols = [1]
xopt, fopt, info, out = snopta(f, x0, lx, ux, lg, ug, rows, cols, options)

returns:

"Finished successfully: optimality conditions satisfied"

I am using Snopt7 on a linux machine. Package build and test run successfully.
Could someone run the code above and tell me if they get the same issue? Any idea how to fix it?

Thank you very much,
Jean

Compiled library location

The Snopt.jl file as is requires some changes in where the Snopt shared library is located. My current setup is just to place the library in usr/local/lib and change all references to it to "libsnopt". This works ok, but I would prefer to work on a clean git branch if at all possible. Assuming the compiled library is located in a fixed location relative to Snopt.jl this shouldn't be hard to implement using the macro @__FILE__. Is there a reason the current implementation is set up the way it is?

Issues Building Package

Hello,

I followed all of the installation steps but get the following error messages when trying to build. I appreciate any feedback you can provide.

(@v1.5) pkg> build Snopt
Building Snopt → ~/.julia/dev/Snopt/deps/build.log
┌ Error: Error building Snopt, showing the last 100 of log:
│ Target: x86_64-apple-darwin19.6.0
│ Thread model: posix
│ InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
│ "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" -cc1as -triple x86_64-apple-macosx10.15.0 -filetype obj -main-file-name cc4351Kw.s -target-cpu penryn -fdebug-compilation-dir /Users/lab_home/.julia/dev/Snopt/deps/src -dwarf-debug-producer "Apple clang version 12.0.0 (clang-1200.0.32.21)" -dwarf-version=4 -mrelocation-model pic -o /var/folders/r8/00bvky2d7zl7rvb8hws551ww0000gn/T//cc04w28h.o /var/folders/r8/00bvky2d7zl7rvb8hws551ww0000gn/T//cc4351Kw.s
│ COLLECT_GCC_OPTIONS= '-O2' '-fPIC' '-v' '-o' 'libsnopt.dylib' '-mmacosx-version-min=10.15.0' '-shared-libgcc' '-mtune=core2' '-Zdynamiclib'
│ /usr/local/Cellar/gcc/10.2.0/libexec/gcc/x86_64-apple-darwin19/10.2.0/f951 snoptch.f -ffixed-form -fPIC -quiet -dumpbase snoptch.f -mmacosx-version-min=10.15.0 -mtune=core2 -auxbase snoptch -O2 -version -fPIC -fintrinsic-modules-path /usr/local/Cellar/gcc/10.2.0/lib/gcc/10/gcc/x86_64-apple-darwin19/10.2.0/finclude -o /var/folders/r8/00bvky2d7zl7rvb8hws551ww0000gn/T//cc4351Kw.s
│ GNU Fortran (Homebrew GCC 10.2.0) version 10.2.0 (x86_64-apple-darwin19)
│ compiled by GNU C version 10.2.0, GMP version 6.2.0, MPFR version 4.0.2, MPC version 1.1.0, isl version isl-0.22.1-GMP

│ warning: MPFR header version 4.0.2 differs from library version 4.1.0.
│ GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
│ GNU Fortran2008 (Homebrew GCC 10.2.0) version 10.2.0 (x86_64-apple-darwin19)
│ compiled by GNU C version 10.2.0, GMP version 6.2.0, MPFR version 4.0.2, MPC version 1.1.0, isl version isl-0.22.1-GMP

│ warning: MPFR header version 4.0.2 differs from library version 4.1.0.
│ GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
│ COLLECT_GCC_OPTIONS= '-O2' '-fPIC' '-v' '-o' 'libsnopt.dylib' '-mmacosx-version-min=10.15.0' '-shared-libgcc' '-mtune=core2' '-Zdynamiclib'
│ as -arch x86_64 -v -force_cpusubtype_ALL -mmacosx-version-min=10.15 -o /var/folders/r8/00bvky2d7zl7rvb8hws551ww0000gn/T//ccMosBtC.o /var/folders/r8/00bvky2d7zl7rvb8hws551ww0000gn/T//cc4351Kw.s
│ Apple clang version 12.0.0 (clang-1200.0.32.21)
│ Target: x86_64-apple-darwin19.6.0
│ Thread model: posix
│ InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
│ "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" -cc1as -triple x86_64-apple-macosx10.15.0 -filetype obj -main-file-name cc4351Kw.s -target-cpu penryn -fdebug-compilation-dir /Users/lab_home/.julia/dev/Snopt/deps/src -dwarf-debug-producer "Apple clang version 12.0.0 (clang-1200.0.32.21)" -dwarf-version=4 -mrelocation-model pic -o /var/folders/r8/00bvky2d7zl7rvb8hws551ww0000gn/T//ccMosBtC.o /var/folders/r8/00bvky2d7zl7rvb8hws551ww0000gn/T//cc4351Kw.s
│ COLLECT_GCC_OPTIONS= '-O2' '-fPIC' '-v' '-o' 'libsnopt.dylib' '-mmacosx-version-min=10.15.0' '-shared-libgcc' '-mtune=core2' '-Zdynamiclib'
│ /usr/local/Cellar/gcc/10.2.0/libexec/gcc/x86_64-apple-darwin19/10.2.0/f951 snoptq.f -ffixed-form -fPIC -quiet -dumpbase snoptq.f -mmacosx-version-min=10.15.0 -mtune=core2 -auxbase snoptq -O2 -version -fPIC -fintrinsic-modules-path /usr/local/Cellar/gcc/10.2.0/lib/gcc/10/gcc/x86_64-apple-darwin19/10.2.0/finclude -o /var/folders/r8/00bvky2d7zl7rvb8hws551ww0000gn/T//cc4351Kw.s
│ GNU Fortran (Homebrew GCC 10.2.0) version 10.2.0 (x86_64-apple-darwin19)
│ compiled by GNU C version 10.2.0, GMP version 6.2.0, MPFR version 4.0.2, MPC version 1.1.0, isl version isl-0.22.1-GMP

│ warning: MPFR header version 4.0.2 differs from library version 4.1.0.
│ GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
│ GNU Fortran2008 (Homebrew GCC 10.2.0) version 10.2.0 (x86_64-apple-darwin19)
│ compiled by GNU C version 10.2.0, GMP version 6.2.0, MPFR version 4.0.2, MPC version 1.1.0, isl version isl-0.22.1-GMP

│ warning: MPFR header version 4.0.2 differs from library version 4.1.0.
│ GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
│ COLLECT_GCC_OPTIONS= '-O2' '-fPIC' '-v' '-o' 'libsnopt.dylib' '-mmacosx-version-min=10.15.0' '-shared-libgcc' '-mtune=core2' '-Zdynamiclib'
│ as -arch x86_64 -v -force_cpusubtype_ALL -mmacosx-version-min=10.15 -o /var/folders/r8/00bvky2d7zl7rvb8hws551ww0000gn/T//cceEO2Ds.o /var/folders/r8/00bvky2d7zl7rvb8hws551ww0000gn/T//cc4351Kw.s
│ Apple clang version 12.0.0 (clang-1200.0.32.21)
│ Target: x86_64-apple-darwin19.6.0
│ Thread model: posix
│ InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
│ "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" -cc1as -triple x86_64-apple-macosx10.15.0 -filetype obj -main-file-name cc4351Kw.s -target-cpu penryn -fdebug-compilation-dir /Users/lab_home/.julia/dev/Snopt/deps/src -dwarf-debug-producer "Apple clang version 12.0.0 (clang-1200.0.32.21)" -dwarf-version=4 -mrelocation-model pic -o /var/folders/r8/00bvky2d7zl7rvb8hws551ww0000gn/T//cceEO2Ds.o /var/folders/r8/00bvky2d7zl7rvb8hws551ww0000gn/T//cc4351Kw.s
│ COLLECT_GCC_OPTIONS= '-O2' '-fPIC' '-v' '-o' 'libsnopt.dylib' '-mmacosx-version-min=10.15.0' '-shared-libgcc' '-mtune=core2' '-Zdynamiclib'
│ /usr/local/Cellar/gcc/10.2.0/libexec/gcc/x86_64-apple-darwin19/10.2.0/f951 sq02lib.f -ffixed-form -fPIC -quiet -dumpbase sq02lib.f -mmacosx-version-min=10.15.0 -mtune=core2 -auxbase sq02lib -O2 -version -fPIC -fintrinsic-modules-path /usr/local/Cellar/gcc/10.2.0/lib/gcc/10/gcc/x86_64-apple-darwin19/10.2.0/finclude -o /var/folders/r8/00bvky2d7zl7rvb8hws551ww0000gn/T//cc4351Kw.s
│ GNU Fortran (Homebrew GCC 10.2.0) version 10.2.0 (x86_64-apple-darwin19)
│ compiled by GNU C version 10.2.0, GMP version 6.2.0, MPFR version 4.0.2, MPC version 1.1.0, isl version isl-0.22.1-GMP

│ warning: MPFR header version 4.0.2 differs from library version 4.1.0.
│ GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
│ GNU Fortran2008 (Homebrew GCC 10.2.0) version 10.2.0 (x86_64-apple-darwin19)
│ compiled by GNU C version 10.2.0, GMP version 6.2.0, MPFR version 4.0.2, MPC version 1.1.0, isl version isl-0.22.1-GMP

│ warning: MPFR header version 4.0.2 differs from library version 4.1.0.
│ GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
│ COLLECT_GCC_OPTIONS= '-O2' '-fPIC' '-v' '-o' 'libsnopt.dylib' '-mmacosx-version-min=10.15.0' '-shared-libgcc' '-mtune=core2' '-Zdynamiclib'
│ as -arch x86_64 -v -force_cpusubtype_ALL -mmacosx-version-min=10.15 -o /var/folders/r8/00bvky2d7zl7rvb8hws551ww0000gn/T//cclf7e3H.o /var/folders/r8/00bvky2d7zl7rvb8hws551ww0000gn/T//cc4351Kw.s
│ Apple clang version 12.0.0 (clang-1200.0.32.21)
│ Target: x86_64-apple-darwin19.6.0
│ Thread model: posix
│ InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
│ "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" -cc1as -triple x86_64-apple-macosx10.15.0 -filetype obj -main-file-name cc4351Kw.s -target-cpu penryn -fdebug-compilation-dir /Users/lab_home/.julia/dev/Snopt/deps/src -dwarf-debug-producer "Apple clang version 12.0.0 (clang-1200.0.32.21)" -dwarf-version=4 -mrelocation-model pic -o /var/folders/r8/00bvky2d7zl7rvb8hws551ww0000gn/T//cclf7e3H.o /var/folders/r8/00bvky2d7zl7rvb8hws551ww0000gn/T//cc4351Kw.s
│ COLLECT_GCC_OPTIONS= '-O2' '-fPIC' '-v' '-o' 'libsnopt.dylib' '-mmacosx-version-min=10.15.0' '-shared-libgcc' '-mtune=core2' '-Zdynamiclib'
│ /usr/local/Cellar/gcc/10.2.0/libexec/gcc/x86_64-apple-darwin19/10.2.0/f951 sqopt.f -ffixed-form -fPIC -quiet -dumpbase sqopt.f -mmacosx-version-min=10.15.0 -mtune=core2 -auxbase sqopt -O2 -version -fPIC -fintrinsic-modules-path /usr/local/Cellar/gcc/10.2.0/lib/gcc/10/gcc/x86_64-apple-darwin19/10.2.0/finclude -o /var/folders/r8/00bvky2d7zl7rvb8hws551ww0000gn/T//cc4351Kw.s
│ GNU Fortran (Homebrew GCC 10.2.0) version 10.2.0 (x86_64-apple-darwin19)
│ compiled by GNU C version 10.2.0, GMP version 6.2.0, MPFR version 4.0.2, MPC version 1.1.0, isl version isl-0.22.1-GMP

│ warning: MPFR header version 4.0.2 differs from library version 4.1.0.
│ GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
│ GNU Fortran2008 (Homebrew GCC 10.2.0) version 10.2.0 (x86_64-apple-darwin19)
│ compiled by GNU C version 10.2.0, GMP version 6.2.0, MPFR version 4.0.2, MPC version 1.1.0, isl version isl-0.22.1-GMP

│ warning: MPFR header version 4.0.2 differs from library version 4.1.0.
│ GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
│ COLLECT_GCC_OPTIONS= '-O2' '-fPIC' '-v' '-o' 'libsnopt.dylib' '-mmacosx-version-min=10.15.0' '-shared-libgcc' '-mtune=core2' '-Zdynamiclib'
│ as -arch x86_64 -v -force_cpusubtype_ALL -mmacosx-version-min=10.15 -o /var/folders/r8/00bvky2d7zl7rvb8hws551ww0000gn/T//ccqiGOrv.o /var/folders/r8/00bvky2d7zl7rvb8hws551ww0000gn/T//cc4351Kw.s
│ Apple clang version 12.0.0 (clang-1200.0.32.21)
│ Target: x86_64-apple-darwin19.6.0
│ Thread model: posix
│ InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
│ "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" -cc1as -triple x86_64-apple-macosx10.15.0 -filetype obj -main-file-name cc4351Kw.s -target-cpu penryn -fdebug-compilation-dir /Users/lab_home/.julia/dev/Snopt/deps/src -dwarf-debug-producer "Apple clang version 12.0.0 (clang-1200.0.32.21)" -dwarf-version=4 -mrelocation-model pic -o /var/folders/r8/00bvky2d7zl7rvb8hws551ww0000gn/T//ccqiGOrv.o /var/folders/r8/00bvky2d7zl7rvb8hws551ww0000gn/T//cc4351Kw.s
│ make: *** [libsnopt.dylib] Error 1
│ ERROR: LoadError: failed process: Process(make FC=gfortran SUFFIX=dylib, ProcessExited(2)) [2]

│ Stacktrace:
│ [1] pipeline_error at ./process.jl:525 [inlined]
│ [2] run(::Cmd; wait::Bool) at ./process.jl:440
│ [3] run(::Cmd) at ./process.jl:438
│ [4] top-level scope at /Users/lab_home/.julia/dev/Snopt/deps/build.jl:10
│ [5] include(::String) at ./client.jl:457
│ [6] top-level scope at none:5
│ in expression starting at /Users/lab_home/.julia/dev/Snopt/deps/build.jl:1
│ caused by [exception 1]
│ failed process: Process(make FC=ifort SUFFIX=dylib, ProcessExited(2)) [2]

│ Stacktrace:
│ [1] pipeline_error at ./process.jl:525 [inlined]
│ [2] run(::Cmd; wait::Bool) at ./process.jl:440
│ [3] run(::Cmd) at ./process.jl:438
│ [4] top-level scope at /Users/lab_home/.julia/dev/Snopt/deps/build.jl:8
│ [5] include(::String) at ./client.jl:457
│ [6] top-level scope at none:5

│ Full log at /Users/lab_home/.julia/dev/Snopt/deps/build.log
└ @ Pkg.Operations /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.5/Pkg/src/Operations.jl:942

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.