tlh24 / cortex

Apache License 2.0
7 stars 0 forks source link

An setup 2 #5

Closed ANaka closed 1 year ago

ANaka commented 1 year ago

finally got this running on my home machine, a couple little things

  1. made a small change to install-deps.sh to get dune build to work. seems to stem from me having my username be naka rather than ubuntu. one thing I'm noticing is that I'm getting a new libtorch subdirectory in the repo... not clear to me why that's happening as I would expect it to be in my home directory (and indeed, there is one there). I just added it to .gitignore rather than getting too fussed about it
  2. added some optional stuff to build a python virtual env
tlh24 commented 1 year ago

All looks great, but is there a reason for preferring pyenv vs the built-in python venv? I tried installing it, but pyenv local 3.10 returns pyenv: version3.10.0' not installed` (??)

Either way, seems we'll need a source script, since ocaml also needs the environment setup properly -- just added it via environment.sh

ANaka commented 1 year ago

All looks great, but is there a reason for preferring pyenv vs the built-in python venv? I tried installing it, but pyenv local 3.10 returns pyenv: version 3.10.0' not installed` (??)

sorry for the late reply. pyenv is just for python installation + version management - so pyenv install 3.10 would work. I like using it with poetry because it lets you re-use python executables among virtual environments that share the same python version - so you end up installing fewer pythons than if you had a bunch of conda environments that all specify a python (I think). I think you can use pyenv in concert with poetry/venv/virtualenv/conda.

Like I said, I've been pretty up on the poetry + pyenv combo lately but one downside is that poetry is python specific, which is actually a big disadvantage here... it looks like ocaml can be installed by conda and maybe opam too... I'll take a crack at that and see if its feasible, IMO that's a pretty low overhead solution if this can all be wrapped up inside a conda env

ANaka commented 1 year ago

conda did a great job from what I can tell - it looks like it is possible to isolate opam and ocaml installs within that.

tlh24 commented 1 year ago

Yeah, I do like getting both languages in one environment! Testing it out, running into this:

# /home/ubuntu/miniconda3/envs/ec3/bin/x86_64-conda-linux-gnu-cc -O2 -fno-strict-aliasing -fwrapv -pthread -g -Wall -fno-common -fexcess-precision=standard -ffunction-sections -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /home/ubuntu/miniconda3/envs/ec3/include -Wl,-E -Wl,-O2 -Wl,--sort-common -Wl,--as-needed -Wl,-z[...]
# /home/ubuntu/miniconda3/envs/ec3/bin/../lib/gcc/x86_64-conda-linux-gnu/9.3.0/../../../../x86_64-conda-linux-gnu/bin/ld: runtime/libcamlrun.a(unix.b.o): in function `caml_time_counter':
# /home/ubuntu/.opam/myswitch/.opam-switch/build/ocaml-variants.5.0.0+options/runtime/unix.c:447: undefined reference to `clock_gettime'
# collect2: error: ld returned 1 exit status
# make[2]: *** [Makefile:822: runtime/ocamlrun] Error 1
# make[2]: Leaving directory '/home/ubuntu/.opam/myswitch/.opam-switch/build/ocaml-variants.5.0.0+options'
# make[1]: *** [Makefile:175: coldstart] Error 2
# make[1]: Leaving directory '/home/ubuntu/.opam/myswitch/.opam-switch/build/ocaml-variants.5.0.0+options'
# make: *** [Makefile:339: world.opt] Error 2

clock_gettime not found ??? Realllly. I must have messed something up. Let me poke around more so we can merge this.

ANaka commented 1 year ago

damn this actually happened to me too today... i'll see what I can figure out

tlh24 commented 1 year ago

I'm not a huge fan of anaconda, so if you feel like going back to poetry, by all means...

(GCC 9.3 is already three years old, e.g.)

On Sun, Apr 23, 2023, 1:43 PM ANaka @.***> wrote:

damn this actually happened to me too today... i'll see what I can figure out

— Reply to this email directly, view it on GitHub https://github.com/tlh24/cortex/pull/5#issuecomment-1519152210, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAOLULSPY4FD53MXFOQSZITXCWIADANCNFSM6AAAAAAXAM5DMI . You are receiving this because your review was requested.Message ID: @.***>