Skip to content

Conversation

@k-okada
Copy link
Member

@k-okada k-okada commented Apr 30, 2022

This requires euslisp/EusLisp#491

Changes:

01d7bc5 (Kei Okada, 11 seconds ago)
comment out existing test for debug

39ec8a2 (Kei Okada, 43 seconds ago)
.github/workflows/config.yml: add linux-nox

2e5d488 (Kei Okada, 9 minutes ago)
move geo code to irtgeo.l for irteusg

  • move (defmethod polygon :draw-on, (defmethod line :draw-on (defmethod faceset :draw-on :set-color from irtgl.l
  • define dummy (defmethod faceset :set-color it will be defined in irtgl.l with opengl code
  • move (defmethod faceset :draw-on, from irtgl.l
  • move (defmethod coordinates :vertices :draw-on, (defmethod geo::float-vector :vertices :draw-on from irtgl.l

3a6bfe1 (Kei Okada, 30 minutes ago)
run compile_irtg.l with eusg

d625240 (Kei Okada, 88 minutes ago)
add irteusg irteusx irteusgl target

aedf0e7 (Kei Okada, 2 hours ago)
clean up Makefile code, fix dependencies

6c55de7 (Kei Okada, 18 hours ago)
Makefile: clean up irtc.c dependency, which is introduced in
b66b6fa

@k-okada k-okada force-pushed the support_nonx branch 5 times, most recently from 5a0244b to 9e43fd7 Compare May 1, 2022 08:05
@k-okada
Copy link
Member Author

k-okada commented May 1, 2022

if you had following error, please run apt remove libpq-dev

/home/runner/work/jskeus/jskeus/eus/LinuxARM/obj/compile_irt.log
compiling file: /home/runner/work/jskeus/jskeus/eus//lib/llib/pgsql.l
BINLOAD cannot dlopen: /usr/lib/x86_64-linux-gnu/libpq.so: cannot open shared object file: No such file or directory
Call Stack (max depth: 20):
  0: at (load "/usr/lib/x86_64-linux-gnu/libpq.so")
  1: at (cond ((probe-file "/usr/lib/libpq.so") (load "/usr/lib/libpq.so")) ((probe-file "/usr/lib/x86_64-linux-gnu/libpq.so") (load "/usr/lib/x86_64-linux-gnu/libpq.so")) ((probe-file "/usr/lib/i386-linux-gnu/libpq.so") (load "/usr/lib/i386-linux-gnu/libpq.so")) (t nil))
  2: at (setq *libpq* (cond ((probe-file "/usr/lib/libpq.so") (load "/usr/lib/libpq.so")) ((probe-file "/usr/lib/x86_64-linux-gnu/libpq.so") (load "/usr/lib/x86_64-linux-gnu/libpq.so")) ((probe-file "/usr/lib/i386-linux-gnu/libpq.so") (load "/usr/lib/i386-linux-gnu/libpq.so")) (t nil)))
  3: at (compiler:compile-file-if-src-newer (format nil "~A/lib/llib/~A" *eusdir* fname) user::*objdir*)
  4: at (compiler:compile-file-if-src-newer (format nil "~A/lib/llib/~A" *eusdir* fname) user::*objdir*)
  5: at (compiler:compile-file-if-src-newer (format nil "~A/lib/llib/~A" *eusdir* fname) user::*objdir*)
  6: at (if (eq (unix:access (format nil "~A/lib/llib/" *eusdir*) unix::o_rdwr) t) (compiler:compile-file-if-src-newer (format nil "~A/lib/llib/~A" *eusdir* fname) user::*objdir*) (progn (unix:mkdir (format nil "/tmp/~A" (unix:getpid))) (unix:system (format nil "cp ~A/lib/llib/~A /tmp/~A/~A" *eusdir* fname (unix:getpid) fname)) (unix:link (format nil "~A/lib/llib/~A" *eusdir* fname) (format nil "/tmp/~A/pgsql.l" (unix:getpid))) (compiler:compile-file-if-src-newer (format nil "/tmp/~A/~A" (unix:getpid) fname) user::*objdir*) (unix:unlink (format nil "/tmp/~A" (unix:getpid)))))
  7: at (compiler::compile-llib-file-if-src-newer "pgsql.l")
  8: at #<compiled-code #X4000277778>
/home/runner/work/jskeus/jskeus/eus/LinuxARM/bin/eus2 0 error: file #P"/usr/lib/x86_64-linux-gnu/libpq.so" not found in (load "/usr/lib/x86_64-linux-gnu/libpq.so")

@k-okada k-okada force-pushed the support_nonx branch 2 times, most recently from 5909218 to 1fb6605 Compare May 1, 2022 08:25
k-okada added 6 commits May 2, 2022 21:02
 move (defmethod polygon :draw-on, (defmethod line :draw-on (defmethod faceset :draw-on :set-color from irtgl.l
define dummy (defmethod faceset :set-color, :paste-texture-from-file it will be defined in irtgl.l with opengl code
move (defmethod faceset :draw-on, from irtgl.l
move (defmethod coordinates :vertices :draw-on, (defmethod geo::float-vector :vertices :draw-on from irtgl.l
disks))
(send (car disks) :set-color (send (elt gl::*face-colors* (* (+ i 4) 32)) :name))
(when (memq :gl *features*)
(send (car disks) :set-color (send (elt gl::*face-colors* (* (+ i 4) 32)) :name)))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will cause read errors on gl::*face-colors* if the gl package is not defined. Using #+:gl might be a better choice.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Affonso-Gui Thanks for feedback.

  1. Set gl as default package : In euslisp/EusLisp@9c5a617, I am defined gl as default package, because "X" is already there. Of course, this breaks backward compatibility and will trouble if you do not update both euslisp and jskeus at same time..
  2. Consider when compile source code with eusg: If we compile source code with #+gl with eus2 or eusg, and load that .so file with eusgl, then the #+gl code is ignored. When we consider euslisp in Non-X environment, we want to compile all code with eusg.
  3. Afcourse, we will not compile hanoi.l with eusg and load with eusgl. I am ok with use #+gl at this section. But if your intend to use #+gl #+xwindow for other codes like https://github.com/euslisp/EusLisp/pull/487/files, we need find better solution.
$ bash ./my-test.sh
+ eus2 my-test.l
"done!!!"
+ eusgl my-test.l
"(memq :gl *features*)"
"#+:gl"
"done!!!"
+ eus2 '(progn (compile-file "my-test.l" :o "my-test-2.so") (exit 0))'
+ eusgl '(progn (compile-file "my-test.l" :o "my-test-gl.so") (exit 0))'
+ eus2 '(load "my-test-2.so" :entry "___my_test")'
"done!!!"
+ eus2 '(load "my-test-gl.so" :entry "___my_test")'
"#+:gl"
"done!!!"
+ eusgl '(load "my-test-2.so" :entry "___my_test")'
"(memq :gl *features*)"
"done!!!"
+ eusgl '(load "my-test-gl.so" :entry "___my_test")'
"(memq :gl *features*)"
"#+:gl"
"done!!!"
```

here is the code.
```
$ cat my-test.l 
(defun my-test-func nil
  (when (memq :gl *features*)
    (print "(memq :gl *features*)"))
#+:gl
  (print "#+:gl")
  (print "done!!!"))

(eval-when
 (eval load)
 (my-test-func)
 (exit 0))
$ cat my-test.sh
set -x

eus2  my-test.l 2> /dev/null
eusgl my-test.l 2> /dev/null

eus2  "(progn (compile-file \"my-test.l\" :o \"my-test-2.so\") (exit 0))"  2> /dev/null
eusgl "(progn (compile-file \"my-test.l\" :o \"my-test-gl.so\") (exit 0))" 2> /dev/null

eus2  "(load \"my-test-2.so\" :entry \"___my_test\")"  2> /dev/null
eus2  "(load \"my-test-gl.so\" :entry \"___my_test\")" 2> /dev/null

eusgl "(load \"my-test-2.so\" :entry \"___my_test\")"  2> /dev/null
```

Copy link
Member

@Affonso-Gui Affonso-Gui May 25, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting point. I was unnaware of the #+/- effect on compiled code. (Is this the same in common lisp?)

Adding gl to the default eus packages ( euslisp/EusLisp@9c5a617 ) does
seem like a nice solution for now!

If the problem persists as we deal with minor / user-defined packages I guess we could also update the compiler entry on this. (e.g. default to dynamic evaluation, force static with #.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants