批处理LOG_NDEBUG

本文提供了一种方法,在C++源文件中查找并替换LOG_NDEBUG宏,包括直接名称查找和使用sed命令进行高级查找与替换。

查找LOG_NDEBUG

 find . -name "*.cpp" -exec sed -n -e '/LOG_NDEBUG/p' {} \;

 

查找//#define LOG_NDEBUG
find . -name "*.cpp" -exec sed -n -e '/^\/\/#define LOG_NDEBUG/p' {} \;

 

去掉注释 // #define LOG_NDEBUG  0,并备份文件

find . -name "*.cpp" -exec sed  -i.bak -r -e  's/^([ ]*\/\/[ ]*)(#define[ ]*LOG_NDEBUG[ ]*0)/\2/p' {} \;

(gprmax) D:\2025Spring\sx\gprMax-v.3.1.7>pip install pycuda Collecting pycuda Using cached pycuda-2025.1.1.tar.gz (1.7 MB) Installing build dependencies ... done Getting requirements to build wheel ... done Preparing metadata (pyproject.toml) ... done Collecting pytools>=2011.2 (from pycuda) Using cached pytools-2025.2.2-py3-none-any.whl.metadata (2.9 kB) Requirement already satisfied: platformdirs>=2.2.0 in d:\programdata\anaconda3\envs\gprmax\lib\site-packages (from pycuda) (4.3.7) Collecting mako (from pycuda) Using cached mako-1.3.10-py3-none-any.whl.metadata (2.9 kB) Collecting siphash24>=1.6 (from pytools>=2011.2->pycuda) Using cached siphash24-1.7.tar.gz (19 kB) Installing build dependencies ... done Getting requirements to build wheel ... done Preparing metadata (pyproject.toml) ... error error: subprocess-exited-with-error × Preparing metadata (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [12 lines of output] + meson setup C:\Users\vbh\AppData\Local\Temp\pip-install-xht_odfu\siphash24_3e73a05c9af445de8b48953f06be3523 C:\Users\vbh\AppData\Local\Temp\pip-install-xht_odfu\siphash24_3e73a05c9af445de8b48953f06be3523\.mesonpy-9nbqlyjm -Dbuildtype=release -Db_ndebug=if-release -Db_vscrt=md --native-file=C:\Users\vbh\AppData\Local\Temp\pip-install-xht_odfu\siphash24_3e73a05c9af445de8b48953f06be3523\.mesonpy-9nbqlyjm\meson-python-native-file.ini The Meson build system Version: 1.8.2 Source dir: C:\Users\vbh\AppData\Local\Temp\pip-install-xht_odfu\siphash24_3e73a05c9af445de8b48953f06be3523 Build dir: C:\Users\vbh\AppData\Local\Temp\pip-install-xht_odfu\siphash24_3e73a05c9af445de8b48953f06be3523\.mesonpy-9nbqlyjm Build type: native build Project name: python-siphash24 Project version: undefined ..\meson.build:4:0: ERROR: Compiler cl cannot compile programs. A full log can be found at C:\Users\vbh\AppData\Local\Temp\pip-install-xht_odfu\siphash24_3e73a05c9af445de8b48953f06be3523\.mesonpy-9nbqlyjm\meson-logs\meson-log.txt [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. error: metadata-generation-failed × Encountered error while generating package metadata. ╰─> See above for output. note: This is an issue with the package mentioned above, not pip. hint: See above for details.
07-26
(base) C:\Users\lenovo\anaconda3># 降级 numpy 到兼容版本 '#' 不是内部或外部命令,也不是可运行的程序 或批处理文件。 (base) C:\Users\lenovo\anaconda3>pip uninstall numpy -y Found existing installation: numpy 2.2.6 Uninstalling numpy-2.2.6: Successfully uninstalled numpy-2.2.6 (base) C:\Users\lenovo\anaconda3>pip install numpy==1.26.4 -i https://pypi.tuna.tsinghua.edu.cn/simple Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple Collecting numpy==1.26.4 Downloading https://pypi.tuna.tsinghua.edu.cn/packages/65/6e/09db70a523a96d25e115e71cc56a6f9031e7b8cd166c1ac8438307c14058/numpy-1.26.4.tar.gz (15.8 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 15.8/15.8 MB 2.7 MB/s eta 0:00:00 Installing build dependencies ... done Getting requirements to build wheel ... done Installing backend dependencies ... done Preparing metadata (pyproject.toml) ... error error: subprocess-exited-with-error × Preparing metadata (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [21 lines of output] + C:\Users\lenovo\anaconda3\python.exe C:\Users\lenovo\AppData\Local\Temp\pip-install-5ydswf3q\numpy_91bbb676ae5d4799ab66900e53f8e7ca\vendored-meson\meson\meson.py setup C:\Users\lenovo\AppData\Local\Temp\pip-install-5ydswf3q\numpy_91bbb676ae5d4799ab66900e53f8e7ca C:\Users\lenovo\AppData\Local\Temp\pip-install-5ydswf3q\numpy_91bbb676ae5d4799ab66900e53f8e7ca\.mesonpy-mjz3iby9 -Dbuildtype=release -Db_ndebug=if-release -Db_vscrt=md --native-file=C:\Users\lenovo\AppData\Local\Temp\pip-install-5ydswf3q\numpy_91bbb676ae5d4799ab66900e53f8e7ca\.mesonpy-mjz3iby9\meson-python-native-file.ini The Meson build system Version: 1.2.99 Source dir: C:\Users\lenovo\AppData\Local\Temp\pip-install-5ydswf3q\numpy_91bbb676ae5d4799ab66900e53f8e7ca Build dir: C:\Users\lenovo\AppData\Local\Temp\pip-install-5ydswf3q\numpy_91bbb676ae5d4799ab66900e53f8e7ca\.mesonpy-mjz3iby9 Build type: native build Project name: NumPy Project version: 1.26.4 WARNING: Failed to activate VS environment: Could not find C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe ..\meson.build:1:0: ERROR: Unknown compiler(s): [['icl'], ['cl'], ['cc'], ['gcc'], ['clang'], ['clang-cl'], ['pgcc']] The following exception(s) were encountered: Running `icl ""` gave "[WinError 2] 系统找不到指定的文件。" Running `cl /?` gave "[WinError 2] 系统找不到指定的文件。" Running `cc --version` gave "[WinError 2] 系统找不到指定的文件。" Running `gcc --version` gave "[WinError 2] 系统找不到指定的文件。" Running `clang --version` gave "[WinError 2] 系统找不到指定的文件。" Running `clang-cl /?` gave "[WinError 2] 系统找不到指定的文件。" Running `pgcc --version` gave "[WinError 2] 系统找不到指定的文件。" A full log can be found at C:\Users\lenovo\AppData\Local\Temp\pip-install-5ydswf3q\numpy_91bbb676ae5d4799ab66900e53f8e7ca\.mesonpy-mjz3iby9\meson-logs\meson-log.txt [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. error: metadata-generation-failed × Encountered error while generating package metadata. ╰─> See above for output. note: This is an issue with the package mentioned above, not pip. hint: See above for details. (base) C:\Users\lenovo\anaconda3> (base) C:\Users\lenovo\anaconda3># 重新安装 OpenCV '#' 不是内部或外部命令,也不是可运行的程序 或批处理文件。 (base) C:\Users\lenovo\anaconda3>pip install --force-reinstall opencv-python==4.12.0.88 opencv-contrib-python==4.12.0.88 -i https://pypi.tuna.tsinghua.edu.cn/simple
08-19
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值