Bignums, libmp and FreeBSD
Kaarthik Sivakumar
kaarthik at comcast.net
Sat Apr 10 22:43:01 EDT 2004
>>> "JJ" == Jerry James <james at xemacs.org> writes:
JJ> Now that's just weird. I could see a dependency from lcrypto to
JJ> lmp. Crypto functions routinely sling very large numbers around,
JJ> after all. But a dependency the other way just doesn't make any
JJ> sense to me at all.
Sorry about this delay in responding to this. Been quite busy. I
checked on the FreeBSD mailing list and apparently libmp requires
libcrypto. But more than that, according to the libmp man page on
FreeBSD 5.x, libmp is deprecated and libcrypto is the way to go for
bignums. So if you are interested in writing to another interface for
bignums, here is the chance :).
I am going to experiment with using the libgmp port on FreeBSD and
compile xemacs with libgmp instead of libmp. If that works, then that
is probably the way to go. In the meantime....
[...]
JJ> Does it work to do this?
JJ> #define pow mp_pow
JJ> #undef min
JJ> #define min mp_min
JJ> #include <mp.h>
JJ> #undef pow
JJ> #undef min
JJ> #define min(a,b) (((a) <= (b)) ? (a) : (b))
I am trying to run make with this change. 'make' for me dies with
this last bit:
---
Loading float-sup.el...
*** Error in XEmacs initialization
(arith-error)
*** Backtrace
really-early-error-handler((arith-error))
/(180.0 0.0)
(defconst radians-to-degrees (/ 180.0 pi) "Radian to degree conversion constant")
# bind (current-load-list)
# (unwind-protect ...)
# bind (load-file-name)
# (unwind-protect ...)
# (unwind-protect ...)
# (unwind-protect ...)
# (unwind-protect ...)
# (unwind-protect ...)
# (unwind-protect ...)
(load-internal "[internal]")
load("/usr/home/programs/xemacs/21.5/lisp/float-sup.el")
(prog1 (load full-path) (unless (memq (quote quick-build) internal-error-checking) (garbage-collect)))
(if full-path (prog1 (load full-path) (unless (memq (quote quick-build) internal-error-checking) (garbage-collect))) (external-debugging-output (format "\nLoad file %s: not found\n" file)) nil)
# bind (full-path)
(let ((full-path (locate-file file load-path (if load-ignore-elc-files (quote (".el" "")) (quote (".elc" ".el" "")))))) (if full-path (prog1 (load full-path) (unless (memq (quote quick-build) internal-error-checking) (garbage-collect))) (external-debugging-output (format "\nLoad file %s: not found\n" file)) nil))
# bind (file)
pureload("float-sup")
(if (pureload file) nil (external-debugging-output "Fatal error during load, aborting") (kill-emacs 1))
(unless (pureload file) (external-debugging-output "Fatal error during load, aborting") (kill-emacs 1))
(while (setq file (car files)) (unless (pureload file) (external-debugging-output "Fatal error during load, aborting") (kill-emacs 1)) (setq files (cdr files)))
# bind (file files)
(let ((files preloaded-file-list) file) (while (setq file (car files)) (unless (pureload file) (external-debugging-output "Fatal error during load, aborting") (kill-emacs 1)) (setq files (cdr files))) (when (not (featurep (quote toolbar))) (defun toolbar-button-p (obj) "No toolbar support." nil) (defun toolbar-specifier-p (obj) "No toolbar support." nil)) (fmakunbound (quote pureload)))
(lambda nil (setq Installation-string (save-current-buffer (set-buffer (get-buffer-create (generate-new-buffer-name " *temp*"))) (fset (quote format-decode) (function (lambda (f l &optional v) l))) (insert-file-contents-internal (expand-file-name "Installation" build-root)) (fmakunbound (quote format-decode)) (prog1 (buffer-substring) (kill-buffer (current-buffer))))) (setq load-path (list source-lisp)) (setq module-load-path (list (expand-file-name "modules" build-root))) (external-debugging-output (format "\nUsing load-path %s" load-path)) (external-debugging-output (format "\nUsing module-load-path %s" module-load-path)) (buffer-disable-undo (get-buffer "*scratch*")) (let ((temp-path (expand-file-name "." (car load-path)))) (setq load-path (nconc (mapcar (function (lambda (i) (concat i "/"))) (directory-files temp-path t "^[^-.]" nil (quote dirs-only))) (cons (file-name-as-directory temp-path) load-path)))) (setq load-warn-when-source-only t) (defun pureload (file) (let ((full-path (locate-file file load-path (if load-ignore-elc-files (quote (".el" "")) (quote (".elc" ".el" "")))))) (if full-path (prog1 (load full-path) (unless (memq (quote quick-build) internal-error-checking) (garbage-collect))) (external-debugging-output (format "\nLoad file %s: not found\n" file)) nil))) (load (expand-file-name "dumped-lisp.el" source-lisp)) (let ((files preloaded-file-list) file) (while (setq file (car files)) (unless (pureload file) (external-debugging-output "Fatal error during load, aborting") (kill-emacs 1)) (setq files (cdr files))) (when (not (featurep (quote toolbar))) (defun toolbar-button-p (obj) "No toolbar support." nil) (defun toolbar-specifier-p (obj) "No toolbar support." nil)) (fmakunbound (quote pureload))) (packages-load-package-dumped-lisps late-package-load-path))()
# (unwind-protect ...)
call-with-condition-handler(really-early-error-handler (lambda nil (setq Installation-string (save-current-buffer (set-buffer (get-buffer-create (generate-new-buffer-name " *temp*"))) (fset (quote format-decode) (function (lambda (f l &optional v) l))) (insert-file-contents-internal (expand-file-name "Installation" build-root)) (fmakunbound (quote format-decode)) (prog1 (buffer-substring) (kill-buffer (current-buffer))))) (setq load-path (list source-lisp)) (setq module-load-path (list (expand-file-name "modules" build-root))) (external-debugging-output (format "\nUsing load-path %s" load-path)) (external-debugging-output (format "\nUsing module-load-path %s" module-load-path)) (buffer-disable-undo (get-buffer "*scratch*")) (let ((temp-path (expand-file-name "." (car load-path)))) (setq load-path (nconc (mapcar (function (lambda (i) (concat i "/"))) (directory-files temp-path t "^[^-.]" nil (quote dirs-only))) (cons (file-name-as-directory temp-path) load-path)))) (setq load-warn-when-source-only t) (defun pureload (file) (let ((full-path (locate-file file load-path (if load-ignore-elc-files (quote (".el" "")) (quote (".elc" ".el" "")))))) (if full-path (prog1 (load full-path) (unless (memq (quote quick-build) internal-error-checking) (garbage-collect))) (external-debugging-output (format "\nLoad file %s: not found\n" file)) nil))) (load (expand-file-name "dumped-lisp.el" source-lisp)) (let ((files preloaded-file-list) file) (while (setq file (car files)) (unless (pureload file) (external-debugging-output "Fatal error during load, aborting") (kill-emacs 1)) (setq files (cdr files))) (when (not (featurep (quote toolbar))) (defun toolbar-button-p (obj) "No toolbar support." nil) (defun toolbar-specifier-p (obj) "No toolbar support." nil)) (fmakunbound (quote pureload))) (packages-load-package-dumped-lisps late-package-load-path)))
# bind (stack-trace-on-error)
(let ((stack-trace-on-error nil)) (call-with-condition-handler (quote really-early-error-handler) (function (lambda nil (setq Installation-string (save-current-buffer (set-buffer (get-buffer-create (generate-new-buffer-name " *temp*"))) (fset (quote format-decode) (function (lambda (f l &optional v) l))) (insert-file-contents-internal (expand-file-name "Installation" build-root)) (fmakunbound (quote format-decode)) (prog1 (buffer-substring) (kill-buffer (current-buffer))))) (setq load-path (list source-lisp)) (setq module-load-path (list (expand-file-name "modules" build-root))) (external-debugging-output (format "\nUsing load-path %s" load-path)) (external-debugging-output (format "\nUsing module-load-path %s" module-load-path)) (buffer-disable-undo (get-buffer "*scratch*")) (let ((temp-path (expand-file-name "." (car load-path)))) (setq load-path (nconc (mapcar (function (lambda (i) (concat i "/"))) (directory-files temp-path t "^[^-.]" nil (quote dirs-only))) (cons (file-name-as-directory temp-path) load-path)))) (setq load-warn-when-source-only t) (defun pureload (file) (let ((full-path (locate-file file load-path (if load-ignore-elc-files (quote (".el" "")) (quote (".elc" ".el" "")))))) (if full-path (prog1 (load full-path) (unless (memq (quote quick-build) internal-error-checking) (garbage-collect))) (external-debugging-output (format "\nLoad file %s: not found\n" file)) nil))) (load (expand-file-name "dumped-lisp.el" source-lisp)) (let ((files preloaded-file-list) file) (while (setq file (car files)) (unless (pureload file) (external-debugging-output "Fatal error during load, aborting") (kill-emacs 1)) (setq files (cdr files))) (when (not (featurep (quote toolbar))) (defun toolbar-button-p (obj) "No toolbar support." nil) (defun toolbar-specifier-p (obj) "No toolbar support." nil)) (fmakunbound (quote pureload))) (packages-load-package-dumped-lisps late-package-load-path)))))
# bind (gc-cons-threshold)
(let ((gc-cons-threshold (if (and purify-flag (not (memq (quote quick-build) internal-error-checking))) 30000 3000000))) (let ((stack-trace-on-error nil)) (call-with-condition-handler (quote really-early-error-handler) (function (lambda nil (setq Installation-string (save-current-buffer (set-buffer (get-buffer-create (generate-new-buffer-name " *temp*"))) (fset (quote format-decode) (function (lambda (f l &optional v) l))) (insert-file-contents-internal (expand-file-name "Installation" build-root)) (fmakunbound (quote format-decode)) (prog1 (buffer-substring) (kill-buffer (current-buffer))))) (setq load-path (list source-lisp)) (setq module-load-path (list (expand-file-name "modules" build-root))) (external-debugging-output (format "\nUsing load-path %s" load-path)) (external-debugging-output (format "\nUsing module-load-path %s" module-load-path)) (buffer-disable-undo (get-buffer "*scratch*")) (let ((temp-path (expand-file-name "." (car load-path)))) (setq load-path (nconc (mapcar (function (lambda (i) (concat i "/"))) (directory-files temp-path t "^[^-.]" nil (quote dirs-only))) (cons (file-name-as-directory temp-path) load-path)))) (setq load-warn-when-source-only t) (defun pureload (file) (let ((full-path (locate-file file load-path (if load-ignore-elc-files (quote (".el" "")) (quote (".elc" ".el" "")))))) (if full-path (prog1 (load full-path) (unless (memq (quote quick-build) internal-error-checking) (garbage-collect))) (external-debugging-output (format "\nLoad file %s: not found\n" file)) nil))) (load (expand-file-name "dumped-lisp.el" source-lisp)) (let ((files preloaded-file-list) file) (while (setq file (car files)) (unless (pureload file) (external-debugging-output "Fatal error during load, aborting") (kill-emacs 1)) (setq files (cdr files))) (when (not (featurep (quote toolbar))) (defun toolbar-button-p (obj) "No toolbar support." nil) (defun toolbar-specifier-p (obj) "No toolbar support." nil)) (fmakunbound (quote pureload))) (packages-load-package-dumped-lisps late-package-load-path))))) (setq pr
e
tension) preloaded-file-list)) (setq load-warn-when-source-only nil) (setq debugger (quote debug)) (when (member "no-site-file" command-line-args) (setq site-start-file nil)) (when (load "site-load" t) (garbage-collect)) (when purify-flag (message "Finding pointers to doc strings...") (Snarf-documentation "DOC") (message "Finding pointers to doc strings...done") (Verify-documentation)) (when (stringp site-start-file) (load "site-init" t)) (setq current-load-list nil) (garbage-collect) (buffer-enable-undo "*scratch*"))
# bind (current-load-list)
# (unwind-protect ...)
# bind (load-file-name)
# (unwind-protect ...)
# (unwind-protect ...)
# (unwind-protect ...)
# (unwind-protect ...)
# (unwind-protect ...)
# (unwind-protect ...)
(load-internal "[internal]")
load("loadup.el")
# bind (purify-flag load-ignore-elc-files)
(let ((load-ignore-elc-files t) (purify-flag nil)) (load "loadup.el"))
# bind (current-load-list)
# (unwind-protect ...)
# bind (load-file-name)
# (unwind-protect ...)
# (unwind-protect ...)
# (unwind-protect ...)
# (unwind-protect ...)
# (unwind-protect ...)
# (unwind-protect ...)
(load-internal "[internal]")
load("loadup-el.el")
(cond ((and (not update-elc-files-to-compile) (not need-to-rebuild-autoloads) (not need-to-rebuild-mule-autoloads) (not need-to-recompile-autoloads) (not need-to-recompile-mule-autoloads))) ((not update-elc-files-to-compile) (condition-case nil (write-region-internal "foo" nil (expand-file-name "src/REBUILD_AUTOLOADS" build-root)) (file-error nil))) (t (let ((bc-bootstrap (mapcar (function (lambda (arg) (concat (update-elc-chop-extension (locate-library arg)) ".el"))) lisp-files-needed-for-byte-compilation)) (bootstrap-other (mapcar (function (lambda (arg) (concat (update-elc-chop-extension (locate-library arg)) ".el"))) lisp-files-needing-early-byte-compilation))) (setq inhibit-autoloads t) (let ((recompile-bc-bootstrap (apply (function nconc) (mapcar (function (lambda (arg) (when (member arg update-elc-files-to-compile) (append (quote ("-f" "batch-byte-compile-one-file")) (list arg))))) bc-bootstrap))) (recompile-bootstrap-other (apply (function nconc) (mapcar (function (lambda (arg) (when (member arg update-elc-files-to-compile) (append (quote ("-f" "batch-byte-compile-one-file")) (list arg))))) bootstrap-other)))) (mapc-internal (function (lambda (arg) (setq update-elc-files-to-compile (delete arg update-elc-files-to-compile)))) (append bc-bootstrap bootstrap-other)) (setq command-line-args (append (quote ("-l" "loadup-el.el" "run-temacs" "-batch" "-no-packages" "-no-autoloads" "-eval" "(setq stack-trace-on-error t)" "-eval" "(setq load-always-display-messages t)")) (when recompile-bc-bootstrap (append (quote ("-eval" "(setq load-ignore-elc-files t)" "-l" "bytecomp")) recompile-bc-bootstrap (quote ("-eval" "(setq load-ignore-elc-files nil)")))) (quote ("-l" "bytecomp")) recompile-bootstrap-other do-autoload-commands (quote ("-eval" "(setq inhibit-autoloads nil)" "-f" "startup-load-autoloads" "-f" "batch-byte-compile")) update-elc-files-to-compile)))) (load "loadup-el.el")))
# bind (do-autoload-commands)
(let ((do-autoload-commands (append (if (or need-to-rebuild-autoloads need-to-rebuild-mule-autoloads) (list "-l" "autoload")) (if need-to-rebuild-autoloads (list "-f" "autoload-update-directory-autoloads" "auto" source-lisp)) (if need-to-rebuild-mule-autoloads (list "-f" "autoload-update-directory-autoloads" "mule" source-lisp-mule)) (if need-to-recompile-autoloads (list "-f" "batch-byte-compile-one-file" aa-lisp)) (if need-to-recompile-mule-autoloads (list "-f" "batch-byte-compile-one-file" aa-lisp-mule))))) (condition-case nil (delete-file (expand-file-name "src/REBUILD_AUTOLOADS" build-root)) (file-error nil)) (cond ((and (not update-elc-files-to-compile) (not need-to-rebuild-autoloads) (not need-to-rebuild-mule-autoloads) (not need-to-recompile-autoloads) (not need-to-recompile-mule-autoloads))) ((not update-elc-files-to-compile) (condition-case nil (write-region-internal "foo" nil (expand-file-name "src/REBUILD_AUTOLOADS" build-root)) (file-error nil))) (t (let ((bc-bootstrap (mapcar (function (lambda (arg) (concat (update-elc-chop-extension (locate-library arg)) ".el"))) lisp-files-needed-for-byte-compilation)) (bootstrap-other (mapcar (function (lambda (arg) (concat (update-elc-chop-extension (locate-library arg)) ".el"))) lisp-files-needing-early-byte-compilation))) (setq inhibit-autoloads t) (let ((recompile-bc-bootstrap (apply (function nconc) (mapcar (function (lambda (arg) (when (member arg update-elc-files-to-compile) (append (quote ("-f" "batch-byte-compile-one-file")) (list arg))))) bc-bootstrap))) (recompile-bootstrap-other (apply (function nconc) (mapcar (function (lambda (arg) (when (member arg update-elc-files-to-compile) (append (quote ("-f" "batch-byte-compile-one-file")) (list arg))))) bootstrap-other)))) (mapc-internal (function (lambda (arg) (setq update-elc-files-to-compile (delete arg update-elc-files-to-compile)))) (append bc-bootstrap bootstrap-other)) (setq command-line-args (append (quote ("-l" "loadup-el.el" "run-temacs" "-batch" "-no-packages" "-no-autoloads" "-eval" "(setq stac
k
ay-messages t)")) (when recompile-bc-bootstrap (append (quote ("-eval" "(setq load-ignore-elc-files t)" "-l" "bytecomp")) recompile-bc-bootstrap (quote ("-eval" "(setq load-ignore-elc-files nil)")))) (quote ("-l" "bytecomp")) recompile-bootstrap-other do-autoload-commands (quote ("-eval" "(setq inhibit-autoloads nil)" "-f" "startup-load-autoloads" "-f" "batch-byte-compile")) update-elc-files-to-compile)))) (load "loadup-el.el"))))
# bind (current-load-list)
# (unwind-protect ...)
# bind (load-file-name)
# (unwind-protect ...)
# (unwind-protect ...)
# (unwind-protect ...)
# (unwind-protect ...)
# (unwind-protect ...)
# (unwind-protect ...)
(load-internal "[internal]")
load("/usr/home/programs/xemacs/21.5/src/../lisp/update-elc.el")
# (condition-case ... . error)
# (catch top-level ...)
*** Killing XEmacs
*** Error code 255
Stop in /usr/home/programs/xemacs/21.5/src.
*** Error code 1
Stop in /usr/home/programs/xemacs/21.5.
----
Maybe you know what this is about?
JJ> If not, I really don't know how to get around the problem. Is
JJ> there any chance you could ask the FreeBSD people to prepend "mp_"
JJ> before all of the MP function names, like the Solaris people did?
I did ask around. Apparently libmp is quite sacred and wont get
changed. Moreover it seems like since it is deprecated in later
versions, nobody is going to change it anyway. Best bet would be with
the libgmp port.
[...]
JJ> Thanks for your help figuring this out, Kaarthik. I'll put in the
JJ> configure patch, at least.
Thanks for providing a chance to do something.. :)
kaarthik
More information about the XEmacs-Beta
mailing list